Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all 935 articles
Browse latest View live

Dynamic Receivers List for Email Metric

$
0
0

It is very common that we have ABAP Reports that sends email to Upon Completion of Loads/ABAP Report Extracts Data for User Requirement. This is Common and wide usage option that We maintain the Distribution list in Program for Specific User. But in many cases this is even common in changing the receivers list in side the Program every time and this needs lot of approvals and transport Requests and migration procedure. To avoid all the stuff and to make our life simple, i have created a program using Standard T-Code SO23, through this the distribution list is not constant and that can be maintained dynamically that works and update in to program for new distribution list to receive metric automatically.

 

To Implement, Please go through the below steps.

 

Step 1: Go to SO23, To Maintain Receivers list, Follow the Steps.

 

Step 2: Goto SO23 and Click on Create.

 

1.png

 

Step 2: Go to Folder Filed and Click on F4/Select Search Help Button to Create Folder.


1.png


Step 3:  On Pop Up, Click on Create Folder, for Shared Radio Button type. So that Folder can be used

by any one.


1.png

 

Step 4: Enter the Folder Name and Description, Where we maintain the email list with in Folder, This folder

Can be created on your own, suppose you want to maintain all your project/Client Specific, you can create

one with the desired Name. Click Ok/Enter shown below.


1.png


Step 5: You will see Status Message Bottom of Screen, That Folder is Created and this Shared folder,

and CLick Ok  in Popup Window.

 

1.png



Step 6: You will see below Screen Now,  Enter the folder Name in Name field and Click enter Title get filled or

Click on Distr.List Content,


1.png


Step 7:  Enter the Name Email Address in Recipient List and select Internet address under Recip.Type

drop down and click on Save, follow the sequence 1,2,3.


1.png



Step 8: A status message given that, the folder With Email List is created.

 

5.png

 

Till now, You have successfully Maintained the and created the Email list.

 

Now, To go SE38, Create a Test Program to check dynamic list either it is working or not..?


Step 9: Go to SE38, and Create Program: ZEMAIL_LIST_CHECK and Save.

Step 10: Copy the Attached Code and Paste it in to above program.

 

CODE: Dynamic Email List Specific Code, Below.

 

Declarations:


5.png

 

Call function Module to get Receivers List maintained in SO23.


5.png


Pass the receivers list to Emailing Function Module,


1.png

 

Or you can Find the attached Program, and execute it. to Execute: Click F8.

Program Executes successfully and you will see pop-up that stating 'Mail has been successfully Sent'.


5.png



Output:

 

Mail Received Successfully on Dynamic Specified Address.



2.png



Now, you can also go to SO23 again and change and add or modify the receivers List.


5.png


Or Click find and go to change mode and maintain the list. shown below.

5.png



You don't need any Transport Request/Package to maintain this.

 

Note: Please make sure that You system is configured for Email Settings for the receivers and SMTP port enabled.

This is Basis Task and Enabling SMTP is one time activity in a system.

 

Please add your comments if there is any thing i can add-on.

 

Thank you.


Adding tabstrip to Screen exit

$
0
0

Hello all,

 

I searched SCN and google, common idea about tabstrip in screen exit, is not possible.

But I found a way ( I dunno this is legal or illegal ). Of course not repair

 

Please note : For this I assume you know screen programing, exit etc.

 

Let me show you with example :

 

Adding tabstrip to Contract screens ( ME31K, ME32K, ME33K ):


First creating tabstrip screen:

Create function group : ZDUMMY

Dummy Screen 1 a.JPG

 

Now 2 screen as subscreen

Screen 9000Screen 9001
Dummy Screen 1.JPGDummy Screen 2.JPG

 

Now lets create screen-exit screen:

 

Tcode : CMOD create or use existing Project for Enhancement : MM06E005 and create screen 201 for header, 211 for item.


Screen 201.JPG

 

Now adding tabstrip to layout.

screen 201 layout.JPG

 

Now trick point is T168 and T168F table maintenance

After all of this:


Cautions : If you try to change this table data SAP warns you

Cautions.JPG


SM30 for T168 and T168F

T168

T168.JPG


T168F

T168F.JPG

And ME31K

 

With Dummy 1

With Dummy 2

ME31K 1.JPGME31K 2.JPG

 

For SD : there is V_T185 view for fcode maintenance. A little bit complex but logic is same.

 

Regards

Tolga

How to change Transport request from Released to Modifiable

$
0
0

How to change Transport request from Released to Modifiable


I think I don’t have to write anything about this
document title itself is sufficient to know what I am going to show you guys.


Sorry forgot to write one comment :::: Please no nonsense with this. It is the way to just rectify the mistake if u mistakenly released the Request.

Once the request is imported to any other system, do not use this. Import buffers may have problems.



 

Step 1: Go to SE38 - Execute Program RDDIT076.

 

 

Step 2: Give your released requests number and execute again.

 


Step 3: After executing, you will get the list of all tasks from the Transport request.  

 

 

 

Step 4: Double click on every Task and change the Status from R è D.   And save it for all the task and request.

 

 


Delete Internal Projects in PS Module

$
0
0

This document gives overview about how to delete the internal
projects which were already created in SAP.

 

 

 

Thistool can be used to display the internal projects details which were deleted
using this report.

 

Following are the options available in this tool:

Select the Projects which wish to delete.

Display the deleted internal projects details.

 

 

 

This tool is compatible with servers running on Windows or Unix OS.

 

This tool is of good use provided userauthorizations are relevant.

 

Regards,

Sreeram

Testing end to end

$
0
0

The overall objective of performing a formal test is to ensure the the new sap module/object meets the business requirements as documented, configured and approved by implemented company. From an SAP implementation point of  view this includes testing of SAP functionality, conversions, interfaces, enhancements, reports and integration with other systems, end user security, process controls, technical infrastructure, volume (production simulation), and stress testing.

 

Testing should focus on the areas that are critical to the operation of the system and/or which involve a large degree of complexity.  The testing work stream  encompasses the following broad categories of testing:

  • Migration Testing – Testing of data conversion and configuration
  • System and Interface Testing – Testing of data flow within and between applications
  • Business Process Testing
  • Infrastructure Testing

   

The following levels of testing could be performed:

  • Unit Testing
  • Conversion(Data Migration) Testing
  • Integration Testing
  • Volume &  Stress Testing
  • User Acceptance (UAT)
  • Disaster Recovery Testing
  • Testing of the backup approach

   

For each level of testing the following method could be adopted:

  • Plan
  • Prepare
  • Execute
  • Report

 

Unit Testing Scope:

It verifies that individual programs execute without error, perform within set standards and are of good quality.

Unit testing is an iterative process that occurs during the configuration and system development effort.

 

During the Realization Phase of SAP implementation, configuration of the standard system takes place based on the work completed during Blueprint and development related to reports, interfaces, conversions and enhancements (RICEF) is performed. 

The Development Team needs to perform Technical Unit Testing for each development before it is handed over to the Functional Team. The Functional Business Process Owner, or applicable designee, needs to perform Functional Unit Testing on development objects when the Development Team delivers them.

As each configuration function is completed and/or development object is delivered, it needs to be also tested by the functional team.

This testing focuses on a unit of work in relative isolation and is referred to as Functional Unit Testing.  The objective of the test will be to demonstrate the key elements of the solution online and to identify any significant omissions or misunderstandings.

 

Unit testing is mostly conducted for SAP ECC functions (transaction codes).

 

Common Entrance Criteria for Unit testing:

The following activities are necessary to enter unit testing:

·         Definition of configuration values.

·         Availability of the Development environment and the associated Clients noted above.

·         Completed system configuration.

·         Complete functional and technical specifications.

·        Approved Unit Test Plans.

·         Completed development of RICEF objects.

 

Common Exit Criteria for Unit testing:

The following criteria are necessary to exit unit testing:

·         Successful results of the Unit Test Plans for Configuration.

·         Successful results of the Unit Test Plans for RICEF objects.

 

Possible Deliverables of Unit testing:

The following deliverables will be produced as a result of the Unit Test Phase:

  • Detailed Unit Test Plans for each RICEF object.
  • Detailed Unit Test Plans for each T-code.
  • Results of Unit Testing for each RICEF object.
  • Results of Unit Testing for each T-code.
  • Inputs necessary to complete Business Process Procedures.

 

Production System Readiness  Testing (PSR)

 

Production System Readiness testing typically involves Volume / Stress Testing which represent the final major testing scenario to be completed after the system is functionally proven. The objective of PSR Testing is to simulate production activity in a simulated production environment to insure that the production environment will adequately process the production load.

 

PSR testing could be conducted in the actual production environment after completion of Integration Testing Cycle.

Introduction to Application Form

$
0
0

Hi All,

 

 

I have tried to document the concept of Application Forms. The concept of Application Forms is to leverage standard SAP functionality for outgoing correspondence. More information on the same is shared as shown below.

 

 

 

 

Introduction to Application Form

 

Abstract: SAP has introduced the concept of Application Form which is majorly used for generating outgoing correspondence. For instance, generating a check in SAP can be achieved by creating an application form.

Transaction: The transaction to call application form in SAP system is ‘EFRM’, the interface looks like below.

IMG1.png

 

An application form creation mandatorily needs the creation of the sub objects as shown in the image above. Let us try to understand the usage and significance of the sub objects.

 

 

The various sub objects needed to complete an application form are:

  • Form Class
  • Hierarchy
  • Form
  • Texts (only valid for SAP Scripts)
  • User Exit Include
  • User Top Include
  • Generated Function Module
  • Attributes


Form Class:
Application forms make use of form classes to create correspondence forms. The form class primarily provides access to underlying data hierarchy, and (ii) the database for procurement of data in the form of ABAP code. Basically, the form class identifies what data will be available for the system to have it in the correspondence form. Some examples of form classes available in SAP are shown below.

IMG2.png


This document will talk about form class ‘FI_CA_DME_CHECK’. As the description says, this form is used to generate correspondence in the form of bank checks.

IMG3.png

 

Each form class has a dedicated library which contains the form routines for a form level. Form levels are the backbone of the data hierarchy, and forms the foundation for an application. In the screenshot above, FI_CA_DME_CHECK is the form class where as HEADER, ADDITIONS, POSITIONEN are the form levels. Now, both the form class and form level share the same library. However, the form class library has the following content:

  • READ and GET subroutines for form for 1:n level
  • READ and FILL subroutines for the 1:1 levels

IMG4.png

 

 

 

Form Level with 1:n relationship

For instance, consider the form level HEADER. The form level HEADER has the following attributes:

IMG5.png

The attributes reflect that the form level HEADER is having 1:n relationship (HEADER -> ADDITIONS/POSITIONEN). The underlying data base table is PAYH which holds the header data of the payment program. Additionally,there is a READ routine specified for this form level. If you click on, the control will be taken to the form class library where this routine is defined.

IMG6.png

This routine has a certain piece of code which enables reading the header data when payment program is triggered.

Similarly, form level ADDITIONS has its own set of routines and structures defined.

IMG7.png

 

Form Level with 1:1 relationship

IMG8.png

The HEADER and RECEIVER have the 1:1 relationship and these are directly assigned to the form level (HEADER in this case). And as mentioned earlier, 1:1 relationships has READ subroutine and FILL subroutine. In this example, the header data in the correspondence (check in this case) will have details about the recipient of the check and the address of the recipient.

 

 

 

 

 

Form: the form type of an application form controls the configuration and the output of the form. Having a form is a MUST thing to create an application form. And once the selection is made from one of the following options, it cannot be changed later.

IMG9.png


Based on what type of form is selected, the way the data should be processed is changed. For instance, if SAPScript is used for correspondence printing (check in this case), then standard texts (created via SO10) are assigned to hierarchy of the application form. Thus, the static or the dynamic data maintained in the texts is processed based on the hierarchy they are tied to.

However, incase smartforms are used as form type the relevant data is placed in the data structures when the print program is executed. So header data in this particular case will be captured in structure FICA_DME_CHECK_STR_HEADER.

IMG10.png

 

 

Texts: The texts feature in an application form is valid only incase SAPScript is used as the form type. The texts are created via transaction SO10 and are capable of printing static as well as dynamic check. For example, following standard text can be created to display the address on the check stub.

IMG11.png

 

Hierarchy: the standard texts created above are now need to be linked to the respective windows in SAPScript. Thus the linking of the standard text takes place at the hierarchy level. Based on what data should reflect what entity from the hierarchy, the linking is done.

IMG12.png


In the above screenshot, the standard text *****SAPDOC is linked to window SAPDOC in the SAPScript.

 

The standard texts are linked at HEADER and ADDITIONS form level. The window in the SAPScript with which the text is linked can be viewed by clicking on .

Configuring HTTP Content Server (1) - Save printed document (1)

$
0
0

I will not speak about installing and configuring the HTTP Content Server, there is already very good documentation about it. Here we will see how to use the content server to store printed document.

For the example, I will used the Sales Order in an IDES Server.

Configuring the output

 

The configuration of the output is done using the transaction NACE.

nace_1.png

To configure Sales Order output, you have to select the Application "V1" and press the button "Output types"

 

 

nace_1.png

The standard Output Types for the sales order is BA00, I will use it.

Select the Output type in the right part, and double click on "Processing routines".

 

 

nace_1.png

The configuration of the Output type "BA00" for printing is this one. Program "ZSD_RVADOR01" and Smartform "ZSD_SALES_ORDER".

 

 

 

 

Now we could open a Sales Order and check if the message BA00 works.

Transaction VA02.

va01_1.png

 

 

Press the button "Print preview" to display the default output type :va02_4.png

 

 

va02_5.png

 

The Smartforms works (good).

 

 

To display witch output type was used, you have to go in the menu :

va02_2.png

 

va02_3.png

 

This output is yellow because it's not already processed. Print preview doesn't process the message, even if you print during a preview !

To configure the automatic creation of this message you have to configure the transaction VV12.

 

vv12.png

(in your system, you could have several key combinations, for example to be able to specify the printer by plant / sales org / ...)

 

if you go in detail of the condition record you will see something like this :

vv12.png

In this doc, we will try to use the option of the last parameter :

vv12.png

 

 

 

Creation of the content repository

 

A content repository is like a directory. It's a place were you could put several kind of data. You could use only one content repository to store all your data. You could use several content repository to be able to move it to another content server, for size issue, ...

 

Transaction OAM1

This is the global transaction where you will find all the customizing of the content server.

oam1.png

 

Go in the menu :

oam1.png

you could access directly using the transaction OAC0.

 

oam1.png

Press the button create (blank page), and press "Full administration"

 

oam1.png

First, set a name of content repository on two digits (you will have problems in some customizing of ArchivLink if you set more)

Set the version (should be 0046)

Set the host or the IP address of the content server

Set the port number (should be 1090)

Set the HTTP Script (should be ContentServer/ContentServer.dll)

Set the OutputDevice to "ARCH"

 

and save it

 

You have create the content repository in the ECC system, not in the Content Server.

 

Now, you could press the button "CS Admin"

oam1.png

When you use MaxDB, you have to set the setting for the driver.

And press the SAVE button

 

A new tab will appear

oam1.png

 

Now we will have to generate the certificat, go in the certificat tab:

oam1.png

 

Press the SEND button send.png

Select the new line that appears and press the button activate send.png

 

Now the Content server is ready

send.png

 

 

 

 

 

Check if the server is Up and Running

 

 

First, you could check quickly using your internet browser :

http://my_content_server_host:1090/ContentServer/ContentServer.dll?serverInfo

(special thanks to Yann to remember me this helpful link)

 

This link must display a list of variables like this :

send.png

 

One of this variable gives you the status : serverStatus="running";

You could see also there is one ContentRepository : Z1

 

 

The second method is to run the report : RSCMST

 

Enter you ContentRepository and press F8

send.png

 

You must run all the steps of this report :

send.png

if you have any problem on your HTTP Content Server, launch this report to have informations on the errors.

 

 

 

 

Configure the archiving of the Sales order

 

A long preparation for a quick configuration ..

 

 

Define document type :

 

Transaction OAM1, go in the menu :

oam1.png

(or directly using transaction OAC2)

 

oam1.png

I specify to the system to save the document in PDF format. I could set "*" if I will be able to store PDF, Word, Excel, ...

 

 

 

Define the links

 

Transaction OAM1, go in the menu :

send.png

(or directly using transaction OAC3)

 

The key corresponding to Sales Order is VBAK :

oam1.png

In the OAC3 trans. we specify for this kind of document to store the document in the ContentRepository Z1 and to use the link table TOA01.

(You could use 99 link tables TOA01 -> TOA99)

Save it

 

 

Test

 

Now, we come back to the configuration of the output type in the VA02 transaction.

(menu : Extras -> Output -> Header -> Edit)

oac3.png

Select the line and Click on the button "Communication method" and select "Print & Archiv"

 

oac3.png

(don't forget to set with the button "Further Data" : "Send immediately" )

 

Back and Save.

 

 

Result

 

In transaction VA03, go in the output type.

oam1.png

 

Select the line and go in the menu :

oam1.png

 

With Sales order you will have a popup like that, but with others transaction like Invoice you won't.

oam1.png

 

Double-click on the document will open you an internet browser :

oam1.png

Configuring HTTP Content Server (1) - Save printed document (2)

$
0
0

More details

 

 

 

The tables :

 

 

If you go in the table you have specify in the transaction OAC3. You will find a new line.

oam1.png

 

 

 

I don't know the ObjectType or the DocumentType

 

Use a trace: Transaction ST05

You will find some select with the good key.

Trans. OAC2 --> Table TOASP

Trans. OAC3 --> Table TOAOM

 

 

 

I don't have an HTTP Content Server but I would like to archive doc

 

It's possible.

You have to create your Content Repository with a different parameter :

oam1.png

(there is not the part of the CS Admin, because you didn't work with Content Server)

 

 

Now create the table : Trans. SE11, copy the SDOKCONT1 table (activate it)

 

 

Now in OAC3, I will set the Content Repository to Z2.

oam1.png

 

I go back in VA02 to repeat output, and when you will ask to display original :

oam1.png

You can see in the URL the parameter : contRep=Z2

 

The table TOA01 now contains an entry for Z2 :

oam1.png

And the table created for the Content Repository Z2 have the entries :

oam1.png

 

 

 

I want to save all the printed Sales Order

 

At the beginning of the doc. I speak about the transaction VV12. You could configure to generate message with the option Print & Archive.

You can't for the value if your users would like to remove-it. But you could force it in the ABAP of the driver program of the Form.

 

 

 

My user don't want to open the document in the internet browser

 

 

Change your user or go in the transaction OAM1 :

oam1.png

 

You could choose between Internet browser or WebGUI (Dynpro including internet browser)

oam1.png

 

 

 

Nothing append, is there a log somewhere

 

Yes, you could check your SM58.

For example, if your HTTP Content Server is down for a time. Go in SM58, you will see all the Archive document waiting for the Content Server. You could relaunch the request to create the data. That means, you don't need to have the HTTP Content Server up all the time.


How to store a binary file as function module

$
0
0

Hello community,

many information is stored in different files with different formats. This information is often important for the customer and there is the question, how to transport this to a customer.

 

BinFile2ABAP is a program which offers this possibility. With BinFile2ABAP you can store each file in an ABAP function module.

It converts the file to an ABAP source code as a function module. With the call of this function module the file is saved on the presentation server and executed.

 

With this kind of information you can extend your possibilities. You can integrate each type of file you want in your ABAP program, e.g. Adobe Flash and Portable Document Format (PDF), Compiled HTML Help (CHM), all image, sound and video formats etc.

 

BinFile2ABAP.jpg

 

BinFile2ABAP is free and you can download it from http://com.stschnell.de from the path Electrifying Light> Binary File to ABAP. It is available as Windows 32-bit and 64-bit application.

 

The process to generate a function module is very easy. Choose the binary file you want, press the button Create ABAP Function Module and save the file to disc. Transfer the FM in your ABAP editor via clipboard or upload - that's all.

 

You can choose the line width, 16, 32, 64 or 125 bytes, this means, 32, 64, 128 or 250 characters in a line. It is dependence from the file size, because the ABAP interpreter allows max. 65535 lines to concatenate. With 125 bytes and 65535 lines you get a file size limit from 8'191'875 bytes. It is possible to create an ABAP source with more lines, but you can not compile it.

 

2014/01/15: Update is available

  • Optimization of the GUI.
  • Add the possibility to use SAP MIME-Repository.
  • Add the possibility to create forms.
  • Minor bug fixing.


Enjoy it.

 

Cheers

Stefan

Using the GOS (Generic Object Services) Class within classic GUI programs

$
0
0

Linked From Document: http://scn.sap.com/docs/DOC-41921

 

This first example demonstrates how to use the GOS class from within regular SAP GUI applications such as report programs.

 

Listing Attachments

 

report  zget_file_list_using_class.

data: lta_sood type standard table of sood, lwa_sood type sood.
data: str_write type string.
data: ls_lporb type sibflporb.

*Specify Business Object Type and Key (BUS1065 = Employees)
parameters: p_key type swo_typeid obligatory default '00000111',
                    p_type type swo_objtyp obligatory default 'BUS1065'.

start-of-selection.

  data: lt_bapirettab type bapirettab.

  ls_lporb-typeid = p_type.
  ls_lporb-instid = p_key.

  call method zcl_oh_my_gos_new=>gos_get_file_list
    exporting
      is_lporb      = ls_lporb
    importing
      t_attachments = lta_sood
      rt_messages   = lt_bapirettab.

  if lt_bapirettab[] is initial.
    data dec_kb type p.

    loop at lta_sood into lwa_sood.

      dec_kb = lwa_sood-objlen / 1024.
      if dec_kb < 1.
        dec_kb = 1.
      endif.
      write: / lwa_sood-objdes, dec_kb, 'KB', ' ', lwa_sood-acnam.
    endloop.
  endif.

 

Uploading Attachments

 

report  zfile_upload_using_class.

*Specify Business Object Type and Key (BUS1065 = Employees))
parameters: p_key type swo_typeid obligatory default '00000111',
            p_type type swo_objtyp obligatory default 'BUS1065',
            p_file type rlgrap-filename obligatory.

at selection-screen on value-request for p_file.
  call function 'F4_FILENAME'
    exporting
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 'P_FILE'
    importing
      file_name     = p_file.

start-of-selection.

  data: g_filename type string.
  data: g_attsize type wsrm_error-wsrm_direction.
  data: it_content like standard table of soli.
  data: ta_srgbtbrel type standard table of srgbtbrel, wa_srgbtbrel type srgbtbrel.
  data: lta_sood type standard table of sood, lwa_sood type sood.
  data: dec_kb type p.
  data: ls_lporb type sibflporb.
  data: lv_objtyp type so_obj_tp.
  data: lt_bapirettab type bapirettab.

  lv_objtyp = 'EXT'.
  ls_lporb-instid = p_key.
  ls_lporb-typeid = p_type.

  move  p_file to g_filename.

  call function 'GUI_UPLOAD'
    exporting
      filename   = g_filename
      filetype   = 'BIN'
    importing
      filelength = g_attsize
    tables
      data_tab   = it_content.

  if sy-subrc eq 0.
    call method zcl_oh_my_gos_new=>gos_attach_file_solitab
      exporting
        iv_name            = g_filename
        iv_content_solitab = it_content
        is_lporb           = ls_lporb
        iv_objtp           = lv_objtyp
        iv_filelength      = g_attsize
      receiving
        rt_messages        = lt_bapirettab.
  endif.

  call method zcl_oh_my_gos_new=>gos_get_file_list
    exporting
      is_lporb      = ls_lporb
    importing
      t_attachments = lta_sood
      rt_messages   = lt_bapirettab.

  if lt_bapirettab[] is initial.
    write: /.
    loop at lta_sood into lwa_sood.
      dec_kb = lwa_sood-objlen / 1024.
      if dec_kb < 1.
        dec_kb = 1.
      endif.

      write: / lwa_sood-objdes, dec_kb, 'KB', ' ', lwa_sood-acnam.
    endloop.
  endif.

 

Downloading Attachments

 

report  zfile_download_using_class.

data: ta_srgbtbrel type standard table of srgbtbrel, wa_srgbtbrel type srgbtbrel.
data: lta_sood type standard table of sood, lwa_sood type sood.
data: dec_kb type p.
data: ls_lporb type sibflporb.
data: lt_bapirettab type bapirettab.

*Specify Business Object Type and Key (BUS1065 = Employees)
parameters: p_key type swo_typeid obligatory default '00000111',
            p_type type swo_objtyp obligatory default 'BUS1065'.

start-of-selection.

  ls_lporb-typeid = p_type.
  ls_lporb-instid = p_key.

  call method zcl_oh_my_gos_new=>gos_get_file_list
    exporting
      is_lporb      = ls_lporb
    importing
      t_attachments = lta_sood
      rt_messages   = lt_bapirettab.

  if lt_bapirettab[] is initial.
    loop at lta_sood into lwa_sood.
      call method zcl_oh_my_gos_new=>gos_download_file_to_gui
        exporting
          file_path  = 'C:\TEMP\TTT'
          attachment = lwa_sood
        importing
          rt_messages = lt_bapirettab.
      if lt_bapirettab[] is initial.
        dec_kb = lwa_sood-objlen / 1024.
        if dec_kb < 1.
          dec_kb = 1.
        endif.

        write: / lwa_sood-objdes, dec_kb, 'KB', ' ', lwa_sood-acnam.
      endif.
    endloop.
  endif.

 

Emailing Attachments

 

report  zfile_email_using_class.

data: ta_srgbtbrel type standard table of srgbtbrel, wa_srgbtbrel type srgbtbrel.
data: lta_sood type standard table of sood, lwa_sood type sood.
data: t_receivers type somlreci1 occurs 0 with header line.

*Specify Business Object Type and Key (BUS1065 = Employees)
parameters: p_key type swo_typeid obligatory default '00000111',
            p_type type swo_objtyp obligatory default 'BUS1065',
            p_recevr type so_recname obligatory default 'elvis@presley.com'.

start-of-selection.

  data: t_st_return type zvnt_st_return.
  data: ls_lporb type sibflporb.
  data: lt_bapirettab type bapirettab.

  ls_lporb-typeid = p_type.
  ls_lporb-instid = p_key.

  call method zcl_oh_my_gos_new=>gos_get_file_list
    exporting
      is_lporb      = ls_lporb
    importing
      t_attachments = lta_sood
      rt_messages   = lt_bapirettab.

  if lt_bapirettab[] is initial.
    data dec_kb type p.

    loop at lta_sood into lwa_sood.
      dec_kb = lwa_sood-objlen / 1024.
      if dec_kb < 1.
        dec_kb = 1.
      endif.
      write: / lwa_sood-objdes, dec_kb, 'KB', ' ', lwa_sood-acnam.

      clear t_receivers.
      t_receivers-receiver = p_recevr.
      t_receivers-rec_type = 'U'.
      append t_receivers.

      call method zcl_oh_my_gos_new=>gos_email_attached_file
        exporting
          folder_region = 'B'
          doctp         = lwa_sood-objtp
          docyr         = lwa_sood-objyr
          docno         = lwa_sood-objno
          t_receivers   = t_receivers[]
        importing
          rt_messages   = lt_bapirettab.
      if lt_bapirettab[] is initial.
        write: '(Attachment Has Been Sent)'.
      endif.
    endloop.
  endif.

Create a PDF from NAST entry and send it as a mail.

$
0
0

Summary:

 

The content in this document helps us to  Creates a Spool request--> convert it into a PDF --> Send PDF as mail attachment.

 

CODE:

 

 

 

*****Select NAST entry based on the input parameter(p_docno)

 

SELECT *

       FROM nast INTO TABLE gint_nast WHERE objky EQ p_docno.

                                      

DELETE ADJACENT DUPLICATES FROM gint_nast COMPARING kschl.

 

 

********Convert current time stamp into UTC format before creating the spool (START TIME)

 

cl_abap_tstmp=>systemtstmp_syst2utc(               "timestamp in UTC

       EXPORTING

         syst_date = sy-datum

         syst_time = sy-uzeit

       IMPORTING

         utc_tstmp = gw_starttime ).

 

*******Pass NAST entry and create a spool request using RSNAST00

 

IF gws_nast-vstat = gc_1.

     gws_nast-erdat = sy-datum.

     gws_nast-eruhr = sy-uzeit.

     gws_nast-usnam = sy-uname.

     gws_nast-manue = gc_x.

     gws_nast-vstat = 0.

     CLEAR gws_nast-datvr.

     CLEAR gws_nast-uhrvr.

     CLEAR gws_nast-cmfpnr.

   ENDIF.

 

   MOVE gws_nast TO nast.

 

   PERFORM einzelnachricht_dialog IN PROGRAM rsnast00 USING sy-subrc.

 

   IF sy-subrc NE 0.

     PERFORM objekt_entsperren IN PROGRAM rsnast00.

     IF sy-subrc EQ 9.

       RAISE print_error_dial.

     ELSE.

       RAISE print_error.

     ENDIF.

   ENDIF.

 

 

   SET SCREEN 0.

   PERFORM objekt_entsperren IN PROGRAM rsnast00.

 

 

 

   COMMIT WORK AND WAIT.


*************************************Convert current time stamp into UTC format before creating the spool (END TIME)

 

  cl_abap_tstmp=>systemtstmp_syst2utc(                         "timestamp in UTC

    EXPORTING

      syst_date = sy-datum

      syst_time = sy-uzeit

    IMPORTING

      utc_tstmp = gw_endtime ).

 

***********************Fetch Spool numbers from TSP01

 

 

   gw_start = gw_starttime.

   CONCATENATE gw_start gc_00 INTO gw_start.

   CONDENSE gw_start NO-GAPS.

 

   gw_end = gw_endtime.

   CONCATENATE gw_end gc_00 INTO gw_end.

   CONDENSE gw_end NO-GAPS.

 

   SELECT * FROM tsp01 INTO TABLE gint_tsp01           "fetch spools from TSP01

     WHERE rqclient EQ sy-mandt

     AND rqowner EQ sy-uname

     AND rqcretime BETWEEN gw_start AND gw_end.

 

************************Get Spool Type

 

SELECT SINGLE * FROM tsp01 INTO w_tsp01 WHERE rqident = w_rqident.

   IF sy-subrc <> 0.

     MESSAGE e126(po) WITH w_rqident RAISING no_such_job.

   ENDIF.

 

* Checks if the job is OTF

   CALL FUNCTION 'RSPO_GET_TYPE_SPOOLJOB'

     EXPORTING

       rqident        = w_rqident

     IMPORTING

       is_otf         = lw_data_is_otf

     EXCEPTIONS

       can_not_access = 1

       OTHERS         = 2.

   IF sy-subrc <> 0.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.


IF lw_data_is_otf = 'X'.

 

 

*************Convert OTF JOB into a PDF

 


CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

        EXPORTING

             src_spoolid              = w_rqident

             no_dialog                = 'X'

*      IMPORTING

*           PDF_BYTECOUNT            = L_BYTECOUNT

        TABLES

             pdf                      = it_pdf

        EXCEPTIONS

             err_no_otf_spooljob      = 1

             err_no_spooljob          = 2

             err_no_permission        = 3

             err_conv_not_possible    = 4

             err_bad_dstdevice        = 5

             user_cancelled           = 6

             err_spoolerror           = 7

             err_temseerror           = 8

             err_btcjob_open_failed   = 9

             err_btcjob_submit_failed = 10

             err_btcjob_close_failed  = 11.

 

   IF sy-subrc = 0.

 

* For page formatting

     CALL FUNCTION 'QCE1_CONVERT'

       TABLES

         t_source_tab         = it_pdf

         t_target_tab         = objcont

*t_target_tab         = gws_objcont

*        t_target_tab         = it_pdf

       EXCEPTIONS

         convert_not_possible = 1

         OTHERS               = 2.

     IF sy-subrc <> 0.

       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

     ENDIF.

   ELSE.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.


ELSE.

 

*************Convert ABAP JOB into a PDF

 

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

        EXPORTING

             src_spoolid              = w_rqident

             no_dialog                = 'X'

*      IMPORTING

*           PDF_BYTECOUNT            = L_BYTECOUNT

        TABLES

             pdf                      = it_pdf

        EXCEPTIONS

             err_no_abap_spooljob     = 1

             err_no_spooljob          = 2

             err_no_permission        = 3

             err_conv_not_possible    = 4

             err_bad_destdevice       = 5

             user_cancelled           = 6

             err_spoolerror           = 7

             err_temseerror           = 8

             err_btcjob_open_failed   = 9

             err_btcjob_submit_failed = 10

             err_btcjob_close_failed  = 11.

 

   IF sy-subrc = 0.

 

* For page formatting

     CALL FUNCTION 'QCE1_CONVERT'

       TABLES

         t_source_tab         = it_pdf

         t_target_tab         = objcont

       EXCEPTIONS

         convert_not_possible = 1

         OTHERS               = 2.

     IF sy-subrc <> 0.

       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

     ENDIF.

 

   ELSE.

 

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

 

 

***********Convert PDF into HEX

 

IF NOT objcont[] IS INITIAL.

 

         REFRESH int_bin_cont.

         TRY.

             CALL METHOD cl_bcs_convert=>soli_to_solix

               EXPORTING

                 it_soli  = objcont[]

               RECEIVING

                 et_solix = int_bin_cont.

           CATCH cx_bcs.

             MESSAGE e445(so).

         ENDTRY.

 

*********Create Mail Body

 

        w_send_request = cl_bcs=>create_persistent( ).

 

         w_document = cl_document_bcs=>create_document(

               i_type    = 'RAW'

               i_text    = int_text

               i_subject = w_sub ).

 

*********Add Attachment to mail Body

 

TRY.

               w_document->add_attachment(

               i_attachment_type    = 'PDF'

               i_attachment_subject = mailtitle

               i_att_content_text   = objcont[]

               i_att_content_hex    = int_bin_cont[] ).

             CATCH cx_document_bcs.

*          WRITE : w_err-textid.

               MESSAGE 'error' TYPE 'E'.

           ENDTRY.

 

***********Send to reciepients

 

w_send_request->set_document( w_document ).

             CLEAR gws_receivers.

             LOOP AT gint_receivers INTO gws_receivers.

               CASE gws_receivers-rec_type.

 

                 WHEN 'U'.

                   w_int_address = gws_receivers-receiver.

                   w_camuser = cl_cam_address_bcs=>create_internet_address( w_int_address ).

                   w_recipient = w_camuser.

 

                 WHEN OTHERS.

                   MESSAGE i865(so) WITH text-006.

                   RAISE sending_failed.

               ENDCASE.

               w_send_request->add_recipient( w_recipient ).

             ENDLOOP.

 

            w_send_request->send_request->set_link_to_outbox( 'X' ).

 

             w_sent_to_all = w_send_request->send( i_with_error_screen = 'X' ).

 

             COMMIT WORK.

 

             IF w_sent_to_all IS INITIAL.

               RAISE sending_failed.

             ENDIF.




Insert Data Via BAPI Using Excel-VBs

$
0
0

Hi,

 

Many of us know how to access RFC / BAPI and read data from SAP server;

today I am going to show you how to save data into Z table Via RFC/BAPI.

Here I assume that you know how to create BAPI from RFC Function module, here we go.

 

Steps Involve.

  • Create Z table for data save   [Quick View]
  • Create BAPI Structure for Data type [Quick View]
  • Create RFC function module [Quick View]
  • Create BAPI from function module [Quick View]
  • Write VB script into MS-Excel [Detail View]

 

  1. Create Z table for data save

 

 

 

     2.  Create BAPI Structure for Data Type

 

 

This will be used to declare import parameter in RFC function module

 

 

    3.Create RFC function module

 

 

 

 

 

 

 

 

 

     4.     Create BAPI from function module

 

 

  1. Writing a VB-Script Detail Explanation.

 

               A.Declare Variable

 

Dim Destination_System As Integer

Dim objBAPIControl As Object 'Function Control (Collective object)

Dim sapConnection As Object 'Connection object

Set objBAPIControl = CreateObject("SAP.Functions")

Set sapConnection = objBAPIControl.Connection

Dim valu As String

 

                B. Connection Parameters

 

                              sapConnection.client = "client number"

                              sapConnection.user = "User name"

                              sapConnection.Language = "E"

                              sapConnection.hostname = "ip address server"

                              sapConnection.Password = "passwird"

                              sapConnection.SystemNumber = "System number"

                              sapConnection.System = "system id"

 

you can get above parameters from SAP Logon properties.

 

 

               C.  Determine Connection is establish or not.

 

If sapConnection.logon(1, True) <> True Then

MsgBox "No connection to R/3!"

Exit Sub 'End program

End If

 

               D.  If connection is successful then perform the save operation.

 

Set objUserList = objBAPIControl.Add("ZBAPI_TESTSAVE")

Worksheets(1).Select

 

For i = 1 To 5

valu = ActiveSheet.Cells(i, 2)

                                    objUserList.exports("NAME1") = valu

returnFunc = objUserList.Call

                                   ActiveSheet.Cells(i, 2) = ""

Next i

MsgBox "Record(s) saved", vbInformation

 

  • First line is to assign function module name as object.
  • second line is to select Excel sheet number
  • Third line to begin loop up to 5 times ( i am going to save 5 names at once)
  • Forth line it so select cells dynamically ActiveSheet.Cells(Row,Column) -

        every time i increment and row changes columns remains static as we have fixed it to 2.

  • Fifth line is to export cell value to RFC function parameter (it will transfer data excel to rfc function parameter)
  • Sixth line is to call / Execute function (Actual execution done and data transferred physically)
  • Seventh line is to clear cell by Row and column
  • eight line is to Return the loop and starts from the beginning until condition fails (that is 5 times)

 

 

Excel Sheet Preview.

 

 

*All the operation is done under

 

Sub Button1_Click()

 

***Above Code***

 

End Sub

 

You can also upload data to standard table just apply your logic and things will be done.

 

-Avirat

Creation of Extended IDOC

$
0
0

Purpose:

The extension IDOC concept comes into action when the standard IDOCs provided by SAP do not meet the customers’ requirement. IDOC is the acronym of Intermediate Document; IDOCs are nothing but a Data Format provided by SAP to transfer data in and out of an SAP system. Data are grouped under this (IDOC) data format for each application in order to maintain consistency while transferring data from one system to another system. Hence each application like order, delivery, invoice etc will have a standard IDOC available along with standard processing programs for the same. When standard IDOC does not meet customer’s requirement, custom extension IDOC are developed to meet the requirement and the corresponding processing program will be enhanced using existing customer exits.

The purpose of the document is to provide the step by step procedure for creating an extension IDOC.

 

Scenario:

In this document, we will discuss the extension of basic IDOC type “DELVRY03‟, this IDOC type is used to group delivery detail. The mentioned IDOC type does not have fields VBUK-KOSTK (Overall picking) and VBUK-KOQUK (Status of pick confirmation in its standard format. But customers business needs demand these fields to be added to delivery details. Hence the basic IDOC type “DELVRY03‟ will be extended as “ZDELVRY03‟ with the two new fields and relevant processing program will be identified and processing logic for the new fields will be included in the relevant customer exits.


Steps To Be Followed:


1) Create a Custom segmentTCODE WE31


It begins with creating a custom segment; type your custom segment name as ZELDP1 and click on the create button as shown below.

ZELDP1.png


When the create button is clicked, the below shown screen will be displayed. Enter a short description for the custom segment and add the required field name and the corresponding data element. Once the required fields are added, click on the save button.


Capture.PNG

After clicking on save button, click on back button, you will see the below show screen. Now click on the segment definition you have created and do Set Release from EDIT menu.


1.png


Here we can see that the release check box is checked.


Without releasing your segment definition you cannot use the segment in any IDOC type.


With this, custom segment creation is completed.


2) Create an Extension IDOC- TCODE WE30


With the above created custom segment, enter a name “ZDELVRY03‟ for the extension IDOC and select on the Extension radio button and click create button.

Click on the icon to create extension IDOC.


2.png


The following popup screen will be displayed. Click on the “Create New‟ radio button to create an extension with the help of a Basic IDOC type. Enter the standard basic type name “delvry03‟ in the “Linked Basic type‟ field and enter a short description and continue.


3.PNG

Note: Use the options –


  • Create New: Create the extension without a reference.
  • Create copy-here the extension can later be changed if necessary
  • Create as successor: Note that only one successor is allowed per release for each extension.

 

The following screen will be displayed with all the standard segment of basic type “delvry03‟. Now we need to add our custom segment to the required segment, in our example we will take segment E1EDL22. We will have to add the custom segment ZELDP1 to segment ELEDL22.


4.png


Click on the segment E1EDL22 to select it.


Select the segment E1EDL22 and click on the create button, an information message will pop up and say Extension segment type(s) will be in child segment type(s) of E1EDL22‟ as shown below. Click on continue.

5.png


Another pop up will be prompted for entering the custom segment name and attributes. Enter the name of the segment ZELDP1, minimum and maximum occurs as shown below.


6.png

The attributes entered here are chosen as per the requirement, when a custom segment is assigned at item level the minimum and maximum number is chosen considering the frequency the segment can occur in the idoc.


Newly added segment is seen as below.


7.png

Save the extension IDOC and click on the back button and go to utilities -> Enhancement -> Assign basic type.


The below pop up will be prompted with the basic type name, which we have used to create our extension type.in our case it is “delvry03” .Click on the continue button.

8.png

Now click on the Set Release menu item in EDIT menu to release the extension IDOC.

A pop up will be prompted as shown below and click Yes to release the Extension IDOC.


9.png

We have successfully created the extension IDOC.


3) Create a logical Message Type – TCODE WE81

By default the screen will be in display mode, go to change mode to enter a new entry. Give some name to the logical message type and a short description. Save the entry.


11.png

4) Assign Logical Message Type to Extension IDOC Type –TCODE WE82

Assign the created extension IDOC type with the above created logical message type. Here you will assign the message type with the extension IDOC type along with the basic type and release version combination as shown below.

Save the entry. Now the message type “ZDELVRY‟ will have the same structure as extension IDOC “ZDELVRY03‟ in runtime.

12.png


5) Create a Partner Profile and Assign Message Type – TCODE WE20

Create a partner profile and assign our message type to it. Also provide details like output types in the tabs.

Click on the Create Outbound Parameter button (An icon with green plus symbol). Following screen will be displayed. Enter the following information.


13.png

Transfer IDOC immediately option is selected to send the IDOC immediately when a delivery document is saved (i.e. each time the delivery document is saved successfully the IDOC will get created and transferred to the port.


6) Finding the Customer Exit and Write the Logic to Populate the Custom Segment


Find the function module. In this case it is the idoc_output_delvry.

Next step is to find the customer exit in the function module to populate the custom segment in the extension IDOC. Check for the PERFORM that fill the Data records internal table and proceed to find the relevant customer exit or directly you can search customer exit for Data record. Usually the customer exits for Data records will be “customer-function “002”.

7.png

7.png

This is the internal table idoc_data that need to be populated to add the new segment‟ZELDP1‟ and the corresponding fields.

Now check the attributes tab to see the package details of this function module

14.png

Go to transaction SMOD and press F4 on enhancement option.

In the pop up select the information system and enter the package name found above in the package option.


15.png

Now a pop up appears that lists the exit names here we will select the exit name whose short text matches our requirement.

7.png

Here we will select the exit name V55K0002 as it matches our requirement.

Now select the radio button Components and press enter.

16.png

On selection, we get the pop up that shows the function module exits. Double click on the exit.

17.png

Upon double clicking the module, we get the necessary include where we will write the code.

18.png

Double click on include name, it is this include which has the custom code for the Data Records.

The below code has the logic for adding the custom segment “ZELDP1‟ as child of “E1EDL22‟ in the data record internal table “IDOC_DATA‟ and what data needs to be populated in the fields of the custom segment.

19.png

Save and activate include ZXTRKU04.

Note: The code written above will be executed only if this enhancement components Project is activated in SMOD.


20.png

7.png

Here we can see that the implementation is checked. If the project is in the deactivate mode then the code will not work.

With this the Extension IDOC is successfully created. 


 

1)

Configuring HTTP Content Server (2) - GOS

$
0
0

Generic Object Services

 

SAP define GOS has the link between ArchiveLink and the SAP Business Workflow.

Simply, GOS is a set of tools you could find in a lot of standard transaction. These tools allow you to save document, URL, .. and link them to transaction.

 

 

GOS quickly

 

You will have a GOS active (sometimes is not active) when you see this icon in the left upper :

 

oam1.png

 

When you click on the arrow you will find a menu like this one :

oam1.png

This menu could change with the SAP Release.

 

 

Example : Transaction MM03

 

If I open the transaction MM03, enter a material number, select the first view, I will have :

oam1.png

I could attach a file using the menu :

oam1.png

 

SAP will open you a pop-up windows to select a file.

 

And when it's done, the option "Attachment list" is activated.

oam1.png

oam1.png

You could have lines without the creator name. It's the case of the document store in the content server.

 

 

 

Modification of the menu

 

First, remember that GOS is mutual of all the transaction where it's activated.

 

 

The table SGOSATTR

 

The table SGOSATTR contain the menu, you could change it using the SM30 transaction.

The logic of the menu order is done with the column NEXT

The logic of the folder entry is done with the column SUBSERVICE

 

pomme.png

 

The line CREATE_ATTA is a directory, the type is set to "3"

The line PCATTA_CREA is an action line, the type is set to "1"

 

You could also find into this table the class. For example the line PCATTA_CREA is link to the class CL_GOS_SRV_ATTACHMENT_CREATE

You could insert your own entry into this table (don't forget to set the correct class), or you could set your own class.

 

 

 

The BADI GOS_SRV_SELECT

 

You could modify the menu using this BADI by filtering.

 

Example : I would like to keep only the possibility to create an attachment and display the list of attachment for the MM03 transaction.

 

 

Code

METHOD if_ex_gos_srv_select~select_services.

   data is_option type SGOS_SELS.


* For Material Master
   IF is_lpor-typeid EQ 'BUS1001006'.

*   Create ...
     MOVE : 'I'           TO is_option-sign ,
            'EQ'          TO is_option-option ,
            'CREATE_ATTA' TO is_option-low.
     APPEND is_option to et_options.

*   Create attachement
     MOVE : 'I'           TO is_option-sign ,
            'EQ'          TO is_option-option ,
            'PCATTA_CREA' TO is_option-low.
     APPEND is_option to et_options.

*   Attachment list
     MOVE : 'I'           TO is_option-sign ,
            'EQ'          TO is_option-option ,
            'VIEW_ATTA'   TO is_option-low.
     APPEND is_option to et_options.

   ENDIF.


ENDMETHOD.

 

The result will be

oam1.png

 

 

 

I'm sure you will say "OK, that"s cool, but why doing this ?"

When you store document inside SAP, not in HTTP Content Server, most of the time the document is saved in the table SOFFCONT1. If you have users like to doing this, your table will grow very quickly. In my previous job, this table was 1/4 of the SAP database size.

So I lock all the possibility to create attachment with this BADI.

 

And others point, is to create specific document type, lets do an example.

 

 

 

 

Add specific entries in Material Master GOS

 

 

Declare document type

 

Transaction OAC2

oam1.png

We define two document types : A picture and the documentation in PDF format.

 

 

Declare the links

 

Transaction OAC3

oam1.png

For the two document type, we define the link. We will used the Content Repository Z1 (define in the first doc) and the link table TOA01

 

 

Modify the menu

 

Transaction SM30 + SGOSATTR

oam1.png

(it's a screenshot of SE16)

First we need to modify a line to insert the new key. We modify the NEXTSRV of the existing line BARCODE

We insert a new line ZMM_MATERIAL with the class CL_ARL_SRV_LINK.

 

 

Insert the code to limit the menu for the MM0(1,2,3) transaction

 

SE19 for the BADI GOS_SRV_SELECT

 

CODE

METHOD if_ex_gos_srv_select~select_services.

   data is_option type SGOS_SELS.


* For Material Master
   IF is_lpor-typeid EQ 'BUS1001006'.

*   Create material attachment
     MOVE : 'I'            TO is_option-sign ,
            'EQ'           TO is_option-option ,
            'ZMM_MATERIAL' TO is_option-low.
     APPEND is_option to et_options.


*   Attachment list
     MOVE : 'I'           TO is_option-sign ,
            'EQ'          TO is_option-option ,
            'VIEW_ATTA'   TO is_option-low.
     APPEND is_option to et_options.

*   Archive (delete)
     MOVE : 'I'           TO is_option-sign ,
            'EQ'          TO is_option-option ,
            'ARL_LINK'   TO is_option-low.
     APPEND is_option to et_options.

   ENDIF.


ENDMETHOD.

 

 

Result

 

oam1.png

You see only the 3 entries filtered

 

If you select Material attachment you will have a pop-up :

oam1.png

 

To post document or picture you only have to make a drag & drop or you could double click on the element : Document or Picture of material.

oam1.png

 

If I ask for the attachment list

oam1.png

 

The entry was created in the TOA01 table

 

oam1.png

Open PO Extraction

$
0
0

Extraction
of Open Purchase orders

 

 

        Open Purchase Orders data retrieved from
tables EKKO, EKPO, EKET, ESLL, EKKN and KONV, which includes the following

 

 


Field



Description



EKKO-BSART



Purchasing Document Type



EKKO-EBELN



Purchasing Document Number



EKKO-LIFNR



Account Number of the Vendor



EKKO-BEDAT



Purchasing Document Date



EKKO-BUKRS



Company Code



EKKO-EKGRP



Purchasing group



EKKO-EKORG



Purchasing Organization



EKKO-ZTERM



Terms of payment key



EKKO-INCO1



Incoterms (part 1)



EKKO-INCO2



Incoterms (part 2)



EKKO-WAERS



Currency Key



EKKO-WKURS



Exchange rate



EKKO-VERKF



Responsible salesperson at vendor's office



EKKO-TELF1



Vendor's telephone number



EKKO-IHREZ



Customer's or vendor's internal reference



EKKO-UNSEZ



Our reference



EKKO-ANGNR



Quotation number



EKKO-IHRAN



Quotation submission date



EKKO-SUBMI



Collective number



EKKO-KNUMV



Number of the document condition



EKKO-KALSM



Procedure (pricing, output control, acct. det.,
  costing...)



EKKO-KDATB



Start of validity period



EKKO-KDATE



End of validity period



EKPO-EBELP



Item Number of Purchasing Document



EKPO-KNTTP



Account assignment category



EKPO-PSTYP



Item category in purchasing document



EKPO-MATNR



Material Number



EKPO-TXZ01



Short text



EKPO-MENGE



Purchase order quantity



EKPO-MEINS



Order unit



EKPO-NETPR



Net price in purchasing document (in document
  currency)



EKPO-PEINH



Price unit



EKPO-WERKS



Plant



EKPO-LGORT



Storage Location



EKPO-BEDNR



Requirement Tracking Number



EKPO-MATKL



Material Group



EKPO-AFNAM



Name of requisitioner/requester



EKPO-INFNR



Number of purchasing info record



EKPO-BPRME



Order Price Unit (Purchasing)



EKPO-WEUNB



Goods Receipt, Non-Valuated



EKPO-EVERS



Shipping instructions



EKPO-INSMK



Stock type



EKPO-INCO1



Incoterms (part 1)



EKPO-INCO2



Incoterms (part 2)



EKPO-MWSKZ



Tax on sales/purchases code



EKPO-TXJCD



Jurisdiction for Tax Calculation - Tax
  Jurisdiction Code



EKPO-BSTAE



Confirmation control key



EKPO-LABNR



Order acknowledgment number



EKPO-KZABS



Order acknowledgment requirement



EKPO-IDNLF



Material Number used by Vendor



EKPO-KUNNR



Customer



EKPO-EMLIF



Vendor to be supplied/who is to receive delivery



EKPO-LBLKZ



Subcontracting vendor



EKPO-ELIKZ



"Delivery Completed" Indicator



EKPO-LOEKZ



Deletion indicator in purchasing document



KONV-STUNR



Step number



KONV-KSCHL



Condition type



KONV-KRECH



Calculation type for condition



KONV-KAWRT



Condition base value



KONV-KBETR



Rate (condition amount or percentage)



KONV-WAERS



Currency Key



KONV-KPEIN



Condition pricing unit



KONV-KMEIN



Condition unit in the document



KONV-LIFNR



Account Number of Vendor or Creditor



KONV-KWERT



Condition value



EKET-ETENR



Delivery Schedule Line Counter



EKET-LPEIN



Category of delivery date



EKET-EINDT



Item delivery date



EKET-MENGE



Scheduled quantity



EKET-SLFDT



Statistics-relevant delivery date



ESLL-PACKNO



Package number



ESLL-INTROW



Line number



ESLL-EXTROW



Line number



ESLL-KTEXT1



Short text



ESLL-MENGE



Quantity with or without plus/minus sign



ESLL-MEINS



Base Unit of Measure



ESLL-BRTWR



Gross price



ESLL-NETWR



Net Value of the Item



ESLL-TBTWR



Gross price



EKKN-ZEKKN



Sequential number of account assignment



EKKN-KOSTL



Cost Center



EKKN-SAKTO



G/L Account
  Number



EKKN-AUFNR



Order Number



EKKN-KOKRS



Controlling
  Area



EKKN-MENGE



Quantity



EKKN-VPROZ



Distribution
  percentage in the case of multiple acct assignment


 

 

 

 

 

 

 

 

  • Provide the Selection Screen with Purchasing
    Document Date, Purchasing Document Type and Plant.

 

 

 

 

 

  • Fetch the Header Data for Open Purchase Order into
    an Internal Table by selecting All Header details from EKKO table by Passing BSTYP
    = ‘F’ , Purchasing Document Date(BEDAT) = Selection Screen Date , BUKRS(Company
    Code) = ‘XXX’ and Purchasing Document Type (BSART) = Selection Screen Purchasing
    Document Type.

 

 

 

 

 

  • For the header data, fetch the relevant item details
    into an internal table from EKPO table by passing LOEKZ = ‘ ’, ELIKZ = ‘ ’ and
    Plant (WERKS) = Selection Screen Plant.

 

 

 

 

 

  • Loop the item data and read the header data, to move
    all the header and item details into a single internal table.

 

 

 

 

 

  • For the header and item details, fetch the relevant
    Schedule line details into an internal table from EKET Table.

 

 

 

 

 

  • For the schedule line details, fetch the relevant History
    per Purchasing Document into an internal table from EKBE Table.

 

 

 

 

 

  • Delete the values in the History per Purchasing
    Document internal table by BEWTP (PO history category) EQ ‘Q’.

 

 

 

 

 

  • Fetch the Service Entry Sheet Header Data, for all History
    per Purchasing Document values from ESSR Table by passing Entry sheet number (LBLNI)
    from ESSR = Document No. of a Reference Document(LFBNR) from EKBE table.

 

 

 

 

 

  • Loop the Schedule line internal table and read the History
    per Purchasing Document.

 

 

 

 

 

  • By passing certain condition move the Schedule line
    details, History per Purchasing Document details into a single internal table.

 

 

 

 

 

  • State the condition EKBE-BEWTP EQ ‘E’ , then loop
    the History per Purchasing Document internal table using key field of PO number
    and item number.

 

 

 

 

 

  • Create an internal table with PO number, PO item, Number
    of Material Document (BELNR), Item in Material Document (BUZEI).

 

 

 

 

 

  • Read that newly created internal table for BELNR,
    With the Key of EBELN, EBELP, BELNR, and BUZEI.

 

 

 

 

 

  • Check for the BELNR Equal is initial, Check for the
    Condition where Movement type (BWART) EQ ‘101’ and PO number and PO item number
    EQ to History per Purchasing Document PO number and PO item number.

 

 

 

 

 

  • Else if check for the movement type ‘102’ and ‘122’
    and EBELN and EBELP, if BWART (Movement type) = 122 add the Quantity for the
    new internal for Schedule line = new internal for Schedule line + History per
    Purchasing Document quantity (MENGE), and move the same for quantity1 as well
    else move the Quantity for the new internal for Schedule line = new internal
    for Schedule line + History per Purchasing Document quantity (MENGE).Check for
    the Quantity for movement type 103 is not initial, for movement type 122 clear
    the Quantity and Set a flag = ‘Y’, else if movement type 101 initial Clear
    quantity1 and Set a flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’ and EBELN
    and EBELP, Quantity 103 = quantity 103 + EKBE-BAMNG.

 

 

 

 

 

  • Else if check for the movement type ‘104’ , ‘122’ and
    ‘124’ and EBELN and EBELP, if BWART (Movement type) = 104 or 124 , add
    quantity1 = quantity1 + EKBE-BAMNG Else add the Quantity for the new internal
    for Schedule line = new internal for Schedule line + History per Purchasing
    Document quantity (MENGE), and move the same for quantity1 as well. Check for
    the Quantity for movement type 103 is not initial for movement type 122 clear
    the Quantity and Set a flag = ‘Y’, else if movement type 101 initial Clear
    quantity1 and Set a flag = ‘X’ else set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘101’ and EBELN
    and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’ , move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and quantity101 =
    quantity101 + EKBE-MENGE and Set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘102’, ‘122’ and
    EBELN and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’, move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and if movement type
    = 122, quantity = quantity + EKBE-MENGE and quantity = quantity + EKBE-MENGE ,
    check quantity103 is not initial Set flag = ‘Y’ and clear quantity else
    quantity = quantity + EKBE-MENGE , check quantity101 is not initial Set flag =
    ‘X’ and clear quantity1 else set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’ and EBELN
    and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’ , move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and WEMNG
    and MENGE Value and append into EKET2 internal table and quantity103 =
    quantity103 + EKBE-MENGE and Set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘104’, ‘122’,
    ‘124’ and EBELN and EBELP is not initial, if flag = ‘Y’, finalquantity103 =
    quantity103 – quantity1 and final value = menge value - finalquantity103 and
    quantity103 = quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101
    = quantity101 – quantity and final value = menge value - finalquantity101 and
    quantity101 = quantity101 + quantity. If final value not equal to ‘0’, move
    EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101
    to menge else  Move finalquantity103 to
    menge and WEMNG and MENGE Value and append into EKET2 internal table and if
    movement type = ‘124’ or ‘104’, quantity1 = quantity + EKBE-MENGE, check
    quantity103 is not initial Set flag = ‘Y’ and clear quantity else quantity1 =
    quantity1 + EKBE-MENGE and quantity = quantity + EKBE-MENGE, check quantity101
    is not initial Set flag = ‘X’ and clear quantity1 else set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘101’, if flag =
    ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge value -
    finalquantity103 and quantity103 = quantity103 + quantity1. Else if flag = ‘X’
    then finalquantity101 = quantity101 – quantity and final value = menge value -
    finalquantity101 and quantity101 = quantity101 + quantity. If final value not
    equal to ‘0’ , move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’
    Move finalquantity101 to menge else  Move
    finalquantity103 to menge and WEMNG and MENGE Value and append into EKET2
    internal table and quantity101 = quantity101 + EKBE-MENGE and Set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘102’, ‘122’, if
    flag = ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge
    value - finalquantity103 and quantity103 = quantity103 + quantity1. Else if
    flag = ‘X’ then finalquantity101 = quantity101 – quantity and final value =
    menge value - finalquantity101 and quantity101 = quantity101 + quantity. If
    final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if
    flag = ‘X’ Move finalquantity101 to menge else
    Move finalquantity103 to menge and WEMNG and MENGE Value and append into
    EKET2 internal table and if movement type = 122, quantity = quantity +
    EKBE-MENGE and quantity = quantity + EKBE-MENGE , check quantity103 is not
    initial Set flag = ‘Y’ and clear quantity else quantity = quantity + EKBE-MENGE
    , check quantity101 is not initial Set flag = ‘X’ and clear quantity1 else set
    flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’, if flag =
    ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge value -
    finalquantity103 and quantity103 = quantity103 + quantity1. Else if flag = ‘X’
    then finalquantity101 = quantity101 – quantity and final value = menge value -
    finalquantity101 and quantity101 = quantity101 + quantity. If final value not
    equal to ‘0’ , move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’
    Move finalquantity101 to menge else  Move
    finalquantity103 to menge and WEMNG and MENGE Value and append into EKET2
    internal table and quantity103 = quantity103 + EKBE-MENGE and Set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘104’, ‘122’,
    ‘124’, if flag = ‘Y’, finalquantity103 = quantity103 – quantity1 and final
    value = menge value - finalquantity103 and quantity103 = quantity103 +
    quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101 – quantity
    and final value = menge value - finalquantity101 and quantity101 = quantity101
    + quantity. If final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT,
    LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge else  Move finalquantity103 to menge and WEMNG and
    MENGE Value and append into EKET2 internal table and if movement type = ‘124’
    or ‘104’, quantity1 = quantity + EKBE-MENGE, check quantity103 is not initial
    Set flag = ‘Y’ and clear quantity else quantity1 = quantity1 + EKBE-MENGE and
    quantity = quantity + EKBE-MENGE, check quantity101 is not initial Set flag =
    ‘X’ and clear quantity1 else set flag = ‘Y’.

 

 

 

 

 

  • Move all the values to BELNR Internal Table and
    append it and calculate menge value = menge value + EKET-MENGE and end if
    Statement and end the Loop Statement.

 

 

 

 

 

  • Else if Check for EKBE-BEWTP = ‘D’, Read the ESSR
    Internal Table with key LBLNI = EKBE-LFBNR and LOKEZ = ‘X’. Check the if SY-SUBRC
    EQ ‘0’ move all value from EKET to EKET1 and Append it, else read the EKBE1
    Internal Table With Key LFBNR = EKBE-LFBNR BEWTP = ‘E’ BWART = ‘102’ . If EKBE1
    is not an initial Move the values from EKET to EKET1 and append the EKET1
    Internal Table.

 

 

 

 

 

  • Else Move the values from EKET to EKET1 and append
    the EKET1 Internal Table and end if statement.

 

 

 

 

 

  • Else Move the values from EKET to EKET1 and append
    the EKET1 Internal Table and end if Statement and end the Loop Statement.

 

 

 

 

 

  • If quantity103 is not initial, finalquantity103 =
    Quantity103 – Quantity1 and final value = Menge Value – Finalquantity103 and
    Set flag = ‘Y’. Else if quantity101 is not initial, finalquantity101 =
    Quantity101 – Quantity and final value = Menge Value – Finalquantity101 and Set
    flag = ‘X’. If final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT,
    LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to EKET2-menge else  Move finalquantity103 to EKET2-menge and
    WEMNG and MENGE Value and append into EKET2 internal table and end if
    statement.

 

 

 

 

 

  • Loop the EKET internal table, if EBELN = EKET-EBELN
    and EBELP = EKET-EBELP, Move Menge Value = Menge value + EKET-MENGE and if
    EBELN and EBELP is initial Move Menge Value = Menge value + EKET-MENGE and Move
    EBELN, EBELP, Menge Value to BELNR and append the internal table and move the
    values of EKET-EBELN to EBELN and EKET-EBELP to EBELP and end the loop
    Statement.

 

 

 

 

 

  • If menge value is not initial move EBELN, EBELP,
    MENGE Value to BELNR internal table and append it and end if Statement.

 

 

 

 

 

  • Again Loop the EKET internal table read the EKBE
    internal Table with key BEWTP = ‘E’ EBELN EBELP, if EKBE is not initial Read
    EKET2 internal table if SY-SUBRC = ‘0’ Read the BELNR internal table, Calculate
    Menge Value = EKET2-MENGE – BELNR-MENGE.
    If EKET2-MENGE = ‘0’, Move the EKBE and EKET Values to EKET1 and Append
    the EKET2 internal table and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-EBELN = EBELN
    and EKET-EBELP = EBELP and EKET2-MENGE = ‘0’, Move all the Values from EKBE,
    EKET to EKET1 and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and EKET1-MENGE =
    MENGE1, append the EKET1 internal table and assign EKET2-MENGE = ‘0’ Modify the
    EKET2 internal table by transporting menge where EBELN and EBELP equal to EKBE
    and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE >
    EKET2-MENGE or EKET-MENGE = EKET2-MENGE, Move all the Values from EKBE and EKET
    to EKET1 and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and EKET1-MENGE = MENGE1,
    append the EKET1 internal table and assign EKET2-MENGE = ‘0’ Modify the EKET2
    internal table by transporting menge where EBELN and EBELP equal to EKBE and
    move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE = ‘0’, Move all the Values from EKBE and EKET to
    EKET1 and EKET1-MENGE = ‘0’ and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and
    append the EKET1 internal table and assign EKET2-MENGE = MENGE1 Modify the
    EKET2 internal table by transporting menge where EBELN and EBELP equal to EKBE
    and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE not equal to ‘0’, Move all the Values from EKBE and
    EKET to EKET1 and EKET1-MENGE = ‘0’ and Calculate MENGE1 = EKET-MENGE -
    EKET2-MENGE and append the EKET1 internal table and assign EKET2-MENGE = MENGE1
    Modify the EKET2 internal table by transporting menge where EBELN and EBELP
    equal to EKBE and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE equal to ‘0’ and EKET-EBELN = EBELN and EKET-EBELP
    = EBELP, Move all the Values from EKBE and EKET to EKET1 and append the EKET1
    internal table and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • End if statement and end if statement and end the
    loop statement.

 

 

 

 

 

  • Sort the EKET1 internal table by EBELN EBELP.

 

 

 

 

 

  • Delete adjacent duplicates EKET1 internal table by
    comparing EBELN EBELP ETENR.

 

 

 

 

 

  • For the header and item details, fetch the relevant Account
    Assignment in Purchasing Document into an internal table EKKN from EKKN Table.

 

 

 

 

 

  • For the header and item details, fetch the relevant Service
    Line Item values into an internal table ESLL from ESLL Table.

 

 

 

 

 

  • For the header and item details, fetch the relevant Item
    Condition Type details into an internal table KONV from KONV Table.

 

 

 

 

 

  • Loop the KONV internal table and Read the Header
    item internal table (DATA) move the EBELN and EBELP and KONV details to KONVF
    final internal table and append it.

 

 

 

 

 

 

 

 

  • For the Service line item ESLL internal table , pass
    the Pack no from ESLL internal table to ESLL Sub pack no and fetch all the
    details into an internal table ESLLS from ESLL table.

 

 

 

 

 

  • Loop the ESLLS internal table and read the ESLL
    internal table with key sub pack no. = pack no.
    Move the corresponding values into a final internal table ESLLFI and
    move the both pack no into different field name.

 

 

 

 

 

  • Loop the final internal table of ESLLFI and read the
    header item internal table(DATA) , get the EBELN and EBELP with the Key pack no.
    move all the values into an internal table ESLLFI1 and append it.

 

 

 

 

 

  • Loop the header item internal table (DATA) and loop
    the KONVF internal table and Loop EKET1 internal table and Loop EKKN internal
    table and move all the values into a final internal table final. If DATA-PSTYP
    EQ ‘9’ , Loop the ESLLFI1 internal table and move the values into an final
    internal table and append it and end the loop statement else append the final
    internal table and end if statement.

 

 

 

 

 

  • If SY-SUBRC NE ‘0’, then perform move all the values
    without EKET1 values into a final internal table and append it and end if
    statement and end loop statement.

 

 

 

 

 

  • If SY-SUBRC NE ‘0’, then perform move all the values
    without KONVF values into a final internal table and append it and end if
    statement and end loop statement.

 

 

 

 

 

  • Then download the final internal table using
    GUI_DOWNLOAD function module into an excel file, with header.

 

 

 

 

 

Changes & defects prevention

 

 

 

 

 

  • Initially the
    amount was calculated based on the formula- rate multiplied by qty.Later on;
    the same program has been changed in such way that therate was
    calculated based amount divided by qty as per business requirement.

 

 

 

 

 

  • We found
    excel format issue, once we downloaded the excel sheet.

 

 

For example if the material unit is inch, it’s
downloaded incorrectly as “” in excel sheet which results incorrect data
alingnment.This issue has been resolved by downloading excel using export
option in menu bar. There is no code change done for this case.


Open PO upload

$
0
0

Upload
Open purchase orders

 

 

The bapi BAPI_PO_CREATE1 used to
upload the Open Purchase Order. The input file is as extracted file.

 

         

  • Use the function module, ‘KD_GET_FILENAME_ON_F4’ to
    get F4 (help) and get to the file to select the file from the location.

 

  • Convert the file in the Excel format to SAP,
    Internal Table format using ‘TEXT_CONVERT_XLS_TO_SAP’.

 

  • Map the values for the fields ZTERM, LIFNR, KOSTL,
    KSCHL, MWSKZ, and SAKTO.

 

  • Loop the converted internal table and move the
    values to corresponding internal tables like header data internal table, item
    data internal table, Schedule line internal table, Condition type internal
    table, Account Assignment into an internal table, service line item into an
    internal table. Do the Validation by mapping the field values for fields using
    Custom tables.

 

  • Loop the header data internal table and item data
    internal table, schedule line internal table, Account Assignments internal
    table, Service line item internal table and Condition type internal table and
    move the values to the values to particular BAPI internal table and append it.

 

  • Call the BAPI and capture the return , check for if
    SY_SUBRC EQ ‘0’, then update in the custom table and update into an internal
    table, else update into an internal table.

 

  • Download the internal table using GUI_DOWNLOAD
    function module with header text.

 

Upload Open purchase orders Text.

To upload the Open Purchase Order

Text, Input file is as extracted file.       

  • Use the function module, ‘FAA_FILE_F4’ to get F4
    (help) and get to the file to select the file from the location.

 

  • Convert the file in the Excel format to SAP,
    Internal Table format using ‘GUI_UPLOAD’.

 

  • Get the file into an internal table, loop the
    internal table do the Conversion exit for EBELN and EBELP.

 

  • Get the Text id into a variable, Calculate the
    length of the text using ‘strlen’.

 

  • Then do the Calculation, if String length is greater
    than 132, get variable mod = strlen MOD 132.

 

  • If variable mod = 0, N = strlen/132. Else Mod is
    greater than 0, strlen = strlen – mod, N = Strlen/132 and N = N +1 and end if
    statement.

 

  • Move length = 132, else N = 1 and length = Strlen
    and end if statement.

 

  • DO N times, Move the Work area text into an internal
    table and append it. Calculate and off 132 characters into the work area.

 

  • Then move the header details, EBELN, EBELP, TEXT ID,
    TD OBJECT = ‘EKKO’ and Language = SY-LANGU.

 

  • Use ‘SAV_TEXT’ Function Module, by moving all header
    details and internal table having long text.

 

  • In the same way repeat the procedure for Item Text
    and SAVE the text using SAVE_TEXT Function Module.

 

  • Check for the SY-SUBRC, if SY-SUBRC EQ 0 Move the
    Text Successfully Saved into a Work area as message else Move text not saved
    successfully into an work area and append the internal table.

 

  • Download the internal table using ‘GUI_DOWNLOAD’ as
    excel file.

Limitations:

  1. The input File should not contain records more than 4000.
  2. It’s better to validate the input file unit with standard SAP MARA table
    unit, before upload.

 

PO Closure and Release

$
0
0

Purchase orders Closure.

 

 

 

 

 

The bapi ‘BAPI_PO_CHANGE’ used to close
the Purchase Order. The input fields are BEDAT, BSART and WERKS, Provide Radio
button to close completely Open Purchase Orders and Partially Open Purchase
Orders.

 

 

  • Provide the Selection Screen with Purchasing
    Document Date, Purchasing Document Type and Plant and Provide button to close
    completely Open Purchase Orders and Partially Open Purchase Orders.

 

 

 

 

 

  • Fetch the Header Data for Open Purchase Order into
    an Internal Table by selecting All Header details from EKKO table by Passing
    BSTYP = ‘F’ , Purchasing Document Date(BEDAT) = Selection Screen Date ,
    BUKRS(Company Code) = ‘XXX’ and Purchasing Document Type (BSART) = Selection
    Screen Purchasing Document Type.

 

 

 

 

 

  • For the header data, fetch the relevant item details
    into an internal table from EKPO table by passing LOEKZ = ‘ ’, ELIKZ = ‘ ’ and
    Plant (WERKS) = Selection Screen Plant.

 

 

 

 

 

  • Loop the item data and read the header data, to move
    all the header and item details into a single internal table.

 

 

 

 

 

  • For the header and item details, fetch the relevant
    Schedule line details into an internal table from EKET Table.

 

 

 

 

 

  • For the schedule line details, fetch the relevant History
    per Purchasing Document into an internal table from EKBE Table.

 

 

 

 

 

  • If Complete Open Purchase Order (Radio button1
    PSNO). Then Delete EKBE where BEWTP EQ ‘Q’. Loop the EKET internal table and
    Read the EKBE internal table with key EBELN and EBELP. If EKBE is an initial
    move the EKET values to EKET1 and append EKET1 into an internal table.

 

 

 

 

 

  • If EKET1 is not initial, then Select EBELN, EBELP,
    KNTTP, PSTYP, MATNR, TXZ01 from EKPO table into an EKPO internal table for all
    entries in EKKO table where EBELN EQ EKKO-EBELN and LOEKZ equal to ‘L’ and
    WERKS equal to selection parameter P_WERKS.

 

 

 

 

 

  • Loop the EKPO internal table, move the values to a
    message log internal table, by moving message text ‘Deletion indicator already
    set for the item’.

 

 

 

 

 

  • Loop the EKET1 internal table, move PO number
    (EBELN), PO item (EBELP) and deletion indicator ‘L’ and append the BAPI
    internal table. In the same move Update field Value ‘X’ and append the BAPI
    update internal table.

 

 

 

 

 

  • Call the BAPI_CHANGE Function module and pass the
    internal table and pass the BAPI_TRANSACTION_COMMIT.

 

 

 

 

 

  • Get the Return values and move it into a message log
    internal table and append it. Use GUI_DOWNLOAD and download the internal table.

 

 

 

 

 

  • Else if Partial Open Purchase Order (Radio Button2
    SONO).

 

 

 

 

 

  • Delete the values in the History per Purchasing
    Document internal table by BEWTP (PO history category) EQ ‘Q’.

 

 

 

 

 

  • Fetch the Service Entry Sheet Header Data, for all History
    per Purchasing Document values from ESSR Table by passing Entry sheet number (LBLNI)
    from ESSR = Document No. of a Reference Document(LFBNR) from EKBE table.

 

 

 

 

 

  • Loop the Schedule line internal table and read the History
    per Purchasing Document.

 

 

 

 

 

  • By passing certain condition move the Schedule line
    details, History per Purchasing Document details into a single internal table.

 

 

 

 

 

  • State the condition EKBE-BEWTP EQ ‘E’ , then loop
    the History per Purchasing Document internal table using key field of PO number
    and item number.

 

 

 

 

 

  • Create an internal table with PO number, PO item, Number
    of Material Document (BELNR), Item in Material Document (BUZEI).

 

 

 

 

 

  • Read that newly created internal table for BELNR,
    With the Key of EBELN, EBELP, BELNR, and BUZEI.

 

 

 

 

 

  • Check for the BELNR Equal is initial, Check for the
    Condition where Movement type (BWART) EQ ‘101’ and PO number and PO item number
    EQ to History per Purchasing Document PO number and PO item number.

 

 

 

 

 

  • Else if check for the movement type ‘102’ and ‘122’
    and EBELN and EBELP, if BWART (Movement type) = 122 add the Quantity for the
    new internal for Schedule line = new internal for Schedule line + History per
    Purchasing Document quantity (MENGE), and move the same for quantity1 as well
    else move the Quantity for the new internal for Schedule line = new internal
    for Schedule line + History per Purchasing Document quantity (MENGE).Check for
    the Quantity for movement type 103 is not initial, for movement type 122 clear
    the Quantity and Set a flag = ‘Y’, else if movement type 101 initial Clear
    quantity1 and Set a flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’ and EBELN
    and EBELP, Quantity 103 = quantity 103 + EKBE-BAMNG.

 

 

 

 

 

  • Else if check for the movement type ‘104’ , ‘122’ and
    ‘124’ and EBELN and EBELP, if BWART (Movement type) = 104 or 124 , add
    quantity1 = quantity1 + EKBE-BAMNG Else add the Quantity for the new internal
    for Schedule line = new internal for Schedule line + History per Purchasing
    Document quantity (MENGE), and move the same for quantity1 as well. Check for
    the Quantity for movement type 103 is not initial for movement type 122 clear
    the Quantity and Set a flag = ‘Y’, else if movement type 101 initial Clear
    quantity1 and Set a flag = ‘X’ else set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘101’ and EBELN
    and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’ , move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and quantity101 =
    quantity101 + EKBE-MENGE and Set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘102’, ‘122’ and
    EBELN and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’, move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and if movement type
    = 122, quantity = quantity + EKBE-MENGE and quantity = quantity + EKBE-MENGE ,
    check quantity103 is not initial Set flag = ‘Y’ and clear quantity else
    quantity = quantity + EKBE-MENGE , check quantity101 is not initial Set flag =
    ‘X’ and clear quantity1 else set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’ and EBELN
    and EBELP is not initial, if flag = ‘Y’, finalquantity103 = quantity103 –
    quantity1 and final value = menge value - finalquantity103 and quantity103 =
    quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101
    – quantity and final value = menge value - finalquantity101 and quantity101 =
    quantity101 + quantity. If final value not equal to ‘0’ , move EBELN, EBELP,
    EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and quantity103 =
    quantity103 + EKBE-MENGE and Set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘104’, ‘122’,
    ‘124’ and EBELN and EBELP is not initial, if flag = ‘Y’, finalquantity103 =
    quantity103 – quantity1 and final value = menge value - finalquantity103 and
    quantity103 = quantity103 + quantity1. Else if flag = ‘X’ then finalquantity101
    = quantity101 – quantity and final value = menge value - finalquantity101 and
    quantity101 = quantity101 + quantity. If final value not equal to ‘0’, move EBELN,
    EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge
    else  Move finalquantity103 to menge and
    WEMNG and MENGE Value and append into EKET2 internal table and if movement type
    = ‘124’ or ‘104’, quantity1 = quantity + EKBE-MENGE, check quantity103 is not
    initial Set flag = ‘Y’ and clear quantity else quantity1 = quantity1 +
    EKBE-MENGE and quantity = quantity + EKBE-MENGE, check quantity101 is not
    initial Set flag = ‘X’ and clear quantity1 else set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘101’, if flag =
    ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge value -
    finalquantity103 and quantity103 = quantity103 + quantity1. Else if flag = ‘X’
    then finalquantity101 = quantity101 – quantity and final value = menge value -
    finalquantity101 and quantity101 = quantity101 + quantity. If final value not
    equal to ‘0’ , move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’
    Move finalquantity101 to menge else  Move
    finalquantity103 to menge and WEMNG and MENGE Value and append into EKET2
    internal table and quantity101 = quantity101 + EKBE-MENGE and Set flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘102’, ‘122’, if
    flag = ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge
    value - finalquantity103 and quantity103 = quantity103 + quantity1. Else if
    flag = ‘X’ then finalquantity101 = quantity101 – quantity and final value =
    menge value - finalquantity101 and quantity101 = quantity101 + quantity. If
    final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if
    flag = ‘X’ Move finalquantity101 to menge else
    Move finalquantity103 to menge and WEMNG and MENGE Value and append into
    EKET2 internal table and if movement type = 122, quantity = quantity +
    EKBE-MENGE and quantity = quantity + EKBE-MENGE , check quantity103 is not
    initial Set flag = ‘Y’ and clear quantity else quantity = quantity + EKBE-MENGE
    , check quantity101 is not initial Set flag = ‘X’ and clear quantity1 else set
    flag = ‘X’.

 

 

 

 

 

  • Else if check for the movement type ‘103’, if flag =
    ‘Y’, finalquantity103 = quantity103 – quantity1 and final value = menge value -
    finalquantity103 and quantity103 = quantity103 + quantity1. Else if flag = ‘X’
    then finalquantity101 = quantity101 – quantity and final value = menge value - finalquantity101
    and quantity101 = quantity101 + quantity. If final value not equal to ‘0’ ,
    move EBELN, EBELP, EINDT, SLFDT, LPEIN, ETENR, if flag = ‘X’ Move
    finalquantity101 to menge else  Move
    finalquantity103 to menge and WEMNG and MENGE Value and append into EKET2
    internal table and quantity103 = quantity103 + EKBE-MENGE and Set flag = ‘Y’.

 

 

 

 

 

  • Else if check for the movement type ‘104’, ‘122’,
    ‘124’, if flag = ‘Y’, finalquantity103 = quantity103 – quantity1 and final
    value = menge value - finalquantity103 and quantity103 = quantity103 +
    quantity1. Else if flag = ‘X’ then finalquantity101 = quantity101 – quantity
    and final value = menge value - finalquantity101 and quantity101 = quantity101
    + quantity. If final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT,
    LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to menge else  Move finalquantity103 to menge and WEMNG and
    MENGE Value and append into EKET2 internal table and if movement type = ‘124’
    or ‘104’, quantity1 = quantity + EKBE-MENGE, check quantity103 is not initial
    Set flag = ‘Y’ and clear quantity else quantity1 = quantity1 + EKBE-MENGE and
    quantity = quantity + EKBE-MENGE, check quantity101 is not initial Set flag =
    ‘X’ and clear quantity1 else set flag = ‘Y’.

 

 

 

 

 

  • Move all the values to BELNR Internal Table and
    append it and calculate menge value = menge value + EKET-MENGE and end if
    Statement and end the Loop Statement.

 

 

 

 

 

  • Else if Check for EKBE-BEWTP = ‘D’, Read the ESSR
    Internal Table with key LBLNI = EKBE-LFBNR and LOKEZ = ‘X’. Check the if SY-SUBRC
    EQ ‘0’ move all value from EKET to EKET1 and Append it, else read the EKBE1
    Internal Table With Key LFBNR = EKBE-LFBNR BEWTP = ‘E’ BWART = ‘102’ . If EKBE1
    is not an initial Move the values from EKET to EKET1 and append the EKET1
    Internal Table.

 

 

 

 

 

  • Else Move the values from EKET to EKET1 and append
    the EKET1 Internal Table and end if statement.

 

 

 

 

 

  • Else Move the values from EKET to EKET1 and append
    the EKET1 Internal Table and end if Statement and end the Loop Statement.

 

 

 

 

 

  • If quantity103 is not initial, finalquantity103 =
    Quantity103 – Quantity1 and final value = Menge Value – Finalquantity103 and
    Set flag = ‘Y’. Else if quantity101 is not initial, finalquantity101 =
    Quantity101 – Quantity and final value = Menge Value – Finalquantity101 and Set
    flag = ‘X’. If final value not equal to ‘0’, move EBELN, EBELP, EINDT, SLFDT,
    LPEIN, ETENR, if flag = ‘X’ Move finalquantity101 to EKET2-menge else  Move finalquantity103 to EKET2-menge and
    WEMNG and MENGE Value and append into EKET2 internal table and end if statement.

 

 

 

 

 

  • Loop the EKET internal table, if EBELN = EKET-EBELN
    and EBELP = EKET-EBELP, Move Menge Value = Menge value + EKET-MENGE and if
    EBELN and EBELP is initial Move Menge Value = Menge value + EKET-MENGE and Move
    EBELN, EBELP, Menge Value to BELNR and append the internal table and move the
    values of EKET-EBELN to EBELN and EKET-EBELP to EBELP and end the loop
    Statement.

 

 

 

 

 

  • If menge value is not initial move EBELN, EBELP,
    MENGE Value to BELNR internal table and append it and end if Statement.

 

 

 

 

 

  • Again Loop the EKET internal table read the EKBE
    internal Table with key BEWTP = ‘E’ EBELN EBELP, if EKBE is not initial Read
    EKET2 internal table if SY-SUBRC = ‘0’ Read the BELNR internal table, Calculate
    Menge Value = EKET2-MENGE – BELNR-MENGE.
    If EKET2-MENGE = ‘0’, Move the EKBE and EKET Values to EKET1 and Append
    the EKET2 internal table and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-EBELN = EBELN
    and EKET-EBELP = EBELP and EKET2-MENGE = ‘0’, Move all the Values from EKBE,
    EKET to EKET1 and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and EKET1-MENGE =
    MENGE1, append the EKET1 internal table and assign EKET2-MENGE = ‘0’ Modify the
    EKET2 internal table by transporting menge where EBELN and EBELP equal to EKBE
    and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE >
    EKET2-MENGE or EKET-MENGE = EKET2-MENGE, Move all the Values from EKBE and EKET
    to EKET1 and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and EKET1-MENGE =
    MENGE1, append the EKET1 internal table and assign EKET2-MENGE = ‘0’ Modify the
    EKET2 internal table by transporting menge where EBELN and EBELP equal to EKBE
    and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE = ‘0’, Move all the Values from EKBE and EKET to
    EKET1 and EKET1-MENGE = ‘0’ and Calculate MENGE1 = EKET-MENGE - EKET2-MENGE and
    append the EKET1 internal table and assign EKET2-MENGE = MENGE1 Modify the
    EKET2 internal table by transporting menge where EBELN and EBELP equal to EKBE
    and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE not equal to ‘0’, Move all the Values from EKBE and
    EKET to EKET1 and EKET1-MENGE = ‘0’ and Calculate MENGE1 = EKET-MENGE -
    EKET2-MENGE and append the EKET1 internal table and assign EKET2-MENGE = MENGE1
    Modify the EKET2 internal table by transporting menge where EBELN and EBELP
    equal to EKBE and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • Else if EKET-MENGE > ‘0’ and EKET-MENGE <
    EKET2-MENGE and EKET2-MENGE equal to ‘0’ and EKET-EBELN = EBELN and EKET-EBELP
    = EBELP, Move all the Values from EKBE and EKET to EKET1 and append the EKET1
    internal table and move EBELN = EKBE-EBELN and EBELP = EKBE-EBELP.

 

 

 

 

 

  • End if statement and end if statement and end the
    loop statement.

 

 

 

 

 

  • Sort the EKET1 internal table by EBELN EBELP.

 

 

 

 

 

  • Delete adjacent duplicates EKET1 internal table by
    comparing EBELN EBELP ETENR.

 

 

 

 

 

  • Loop the EKET1 internal table, move PO number
    (EBELN), PO item (EBELP) and deletion indicator ‘L’ and Move Schedule line
    (ETENR) and Move Quantity (MENGE) and append the BAPI internal table. In the
    same move Update field Value ‘X’ and append the BAPI update internal table.

 

 

 

 

 

  • Call the BAPI_CHANGE Function module and pass the internal
    table and pass the BAPI_TRANSACTION_COMMIT.

 

 

 

 

 

  • Get the Return values and move it into a message log
    internal table and append it. Use GUI_DOWNLOAD and download the internal table.

Creation and Consumption of Web Services

$
0
0

1 Purpose

A Web service is a modularized, executable unit. It can be called in heterogeneous system landscapes and is not restricted to a single host system. Each output is determined based on the given input parameters. This output is then passed back to the caller. Web service is a software system designed to support interoperablemachine-to-machine interaction over a network

For example, Web services can serve to perform a credit card check, convert a currency amount, send a price query to a provider, or simply to place an order. Also, industrial manufacturers can provide their customers, partners, and suppliers with Web services for implementation in their own programs in order to set up cross-system supply chain solutions.

This document will discuss two parts of a Web Service –

        1.     Consuming a web service

        2.     Creating a Web Service in SAP


2 Consuming a Web Service

     To consume a Web service, we need to create the following:

         a.    Create proxy for the Web service in the ABAP Workbench using a WSDL document as a basis.

         b.    Then create a logical port to define the runtime features of the Web service client proxy. (This will be created by BASIS hence we will not be discussing it in this document)

        c.    Then to call the web service, create an ABAP program to provide input and get output.


     2.1 To Create a Proxy

           1. Go to Transaction SE80 -> Edit Object -> Enterprise services -> Create

                         1.png


               2. Select External WSDL -> Continue

                    2.png

               3. Select Local File -> Continue.

                              3.png

          4. Input a location -> Continue -> ZES_ (Prefix) -> Continue

                              4.png

             5. The creation of Proxy is Completed and Save and Activate, and Proxy is created.

                         5.png

       

      2.2 Create a Logical Port

               NA for SAP ABAP Development.


        

      2.3 Program to call the Web Service

               1.      The structure of the proxy is :

                              6.png

                        

                    2.     Only Constructor and Retrieve methods can be called in the program to use the Web service.

 

                    3.     Create References to Proxy class of ZES_XXXXXX

            1. Data – LO_TIME TYPE REF TO ZES_XXXXXX

 

                    4.     Create References to Input structure of Retrieve class

 

                    5.     Create References to Output structure of Retrieve Class

 

                    6.     Create object for proxy class reference created in step 3

              

                    7.     Assign values to the input structure created to be used in the Retrieve class

 

                    8.     Call RETRIEVE method of proxy class and provide input and output structures. 


3.         Creating a Web Service

      1. Create a FM, say ‘YFM_CREATE_WEB_SERVICE_TEST’ which is RFC Enabled.
      2. Go to Utilities -> More Utilities -> Create Web Service -> From the Function Module

                         7.png

                    3.    Enter Web Service name and Description, and Continue.

                         8.png

               4.   Check Map Name -> Continue

        If the checkbox Name Mapping is ticked, the wizard accepts the existing names for the end point          9.png

5.   Choose approriate input -> Continue .

10.png

6.     Tick Local object ->Continue

11.png

7.     Click on Complete.

12.png

8.     The Web Service has been created and now activate it.

13.png

9.     Now, to test the Web Service

                      Press F8 -> Choose Generate Request Template -> Execute -> Execute the Request -> Output Successfully recieved

                    14.png

                     15.png

                         Call Successful:

                         15.png

 

    

Steps to find the objects ( Purchase Requisition/ Purchase Order/ Service Entry Sheet ) which are not in compeleted status.

$
0
0

1. Steps to find the Pending POs which are not in completed status.

 

 

  • Go to table SWIWIOBJCT.
  • In the selection screen, give the below details
    and execute.
    • Object type       : BUS2012
    • Status               : STARTED
    • Task                  : WS90100179
    • Creation date   : As per the requirement
  • Select the values in the field ‘Key’.
  • Go to table EKKO.
  • In the selection screen, give the below details
    and execute.
    • Purchasing Document : Values in field ‘Key’ from SWIWIOBJCT table
    • Deletion Indicator        : Not Equal to X
    • Subject to release        : X

 

 

 

2. Steps to find the Pending PRs which are not in completed status.

 

 

  • Go to table SWIWIOBJCT.
  • In the selection screen, give the below details and execute.
    • Object type      : BUS2105
    • Status               : STARTED
    • Task                  : WS90100170
    • Creation date   : As per the requirement
  • Select the values in the field ‘Key’.
  • Go to table EBAN.
  • In the selection screen, give the below details and execute.
    • Purchase Requisition  :Values in field ‘Key’ from SWIWIOBJCT table
    • Deletion Indicator        : Not Equal to X
    • Subject to release        : X

 

 

 

3. Steps to find the Pending PRs which are not in completed status.

 

 

  • Go to table SWIWIOBJCT.
  • In the selection screen, give the below details
    and execute.
    • Object type     : BUS2091
    • Status               : STARTED
    • Task                  : WS90100180
    • Creation date : As per the requirement
  • Select the values in the field ‘Key’.
  • Go to table ESSR.
  • In the selection screen, give the below details and execute.
    • Entry Sheet                  : Values in field ‘Key’ from SWIWIOBJCT table
    • Acceptance                  : Equal to Space
    • Deletion Indicator        : Not Equal to X
    • Subject to release        : X

Configuring HTTP Content Server (1) - Save printed document (1)

$
0
0

I will not speak about installing and configuring the HTTP Content Server, there is already very good documentation about it. Here we will see how to use the content server to store printed document.

For the example, I will used the Sales Order in an IDES Server.

Configuring the output

 

The configuration of the output is done using the transaction NACE.

nace_1.png

To configure Sales Order output, you have to select the Application "V1" and press the button "Output types"

 

 

nace_1.png

The standard Output Types for the sales order is BA00, I will use it.

Select the Output type in the right part, and double click on "Processing routines".

 

 

nace_1.png

The configuration of the Output type "BA00" for printing is this one. Program "ZSD_RVADOR01" and Smartform "ZSD_SALES_ORDER".

 

 

 

 

Now we could open a Sales Order and check if the message BA00 works.

Transaction VA02.

va01_1.png

 

 

Press the button "Print preview" to display the default output type :va02_4.png

 

 

va02_5.png

 

The Smartforms works (good).

 

 

To display witch output type was used, you have to go in the menu :

va02_2.png

 

va02_3.png

 

This output is yellow because it's not already processed. Print preview doesn't process the message, even if you print during a preview !

To configure the automatic creation of this message you have to configure the transaction VV12.

 

vv12.png

(in your system, you could have several key combinations, for example to be able to specify the printer by plant / sales org / ...)

 

if you go in detail of the condition record you will see something like this :

vv12.png

In this doc, we will try to use the option of the last parameter :

vv12.png

 

 

 

Creation of the content repository

 

A content repository is like a directory. It's a place were you could put several kind of data. You could use only one content repository to store all your data. You could use several content repository to be able to move it to another content server, for size issue, ...

 

Transaction OAM1

This is the global transaction where you will find all the customizing of the content server.

oam1.png

 

Go in the menu :

oam1.png

you could access directly using the transaction OAC0.

 

oam1.png

Press the button create (blank page), and press "Full administration"

 

oam1.png

First, set a name of content repository on two digits (you will have problems in some customizing of ArchivLink if you set more)

Set the version (should be 0046)

Set the host or the IP address of the content server

Set the port number (should be 1090)

Set the HTTP Script (should be ContentServer/ContentServer.dll)

Set the OutputDevice to "ARCH"

 

and save it

 

You have create the content repository in the ECC system, not in the Content Server.

 

Now, you could press the button "CS Admin"

oam1.png

When you use MaxDB, you have to set the setting for the driver.

And press the SAVE button

 

A new tab will appear

oam1.png

 

Now we will have to generate the certificat, go in the certificat tab:

oam1.png

 

Press the SEND button send.png

Select the new line that appears and press the button activate send.png

 

Now the Content server is ready

send.png

 

 

 

 

 

Check if the server is Up and Running

 

 

First, you could check quickly using your internet browser :

http://my_content_server_host:1090/ContentServer/ContentServer.dll?serverInfo

(special thanks to Yann to remember me this helpful link)

 

This link must display a list of variables like this :

send.png

 

One of this variable gives you the status : serverStatus="running";

You could see also there is one ContentRepository : Z1

 

 

The second method is to run the report : RSCMST

 

Enter you ContentRepository and press F8

send.png

 

You must run all the steps of this report :

send.png

if you have any problem on your HTTP Content Server, launch this report to have informations on the errors.

 

 

 

 

Configure the archiving of the Sales order

 

A long preparation for a quick configuration ..

 

 

Define document type :

 

Transaction OAM1, go in the menu :

oam1.png

(or directly using transaction OAC2)

 

oam1.png

I specify to the system to save the document in PDF format. I could set "*" if I will be able to store PDF, Word, Excel, ...

 

 

 

Define the links

 

Transaction OAM1, go in the menu :

send.png

(or directly using transaction OAC3)

 

The key corresponding to Sales Order is VBAK :

oam1.png

In the OAC3 trans. we specify for this kind of document to store the document in the ContentRepository Z1 and to use the link table TOA01.

(You could use 99 link tables TOA01 -> TOA99)

Save it

 

 

Test

 

Now, we come back to the configuration of the output type in the VA02 transaction.

(menu : Extras -> Output -> Header -> Edit)

oac3.png

Select the line and Click on the button "Communication method" and select "Print & Archiv"

 

oac3.png

(don't forget to set with the button "Further Data" : "Send immediately" )

 

Back and Save.

 

 

Result

 

In transaction VA03, go in the output type.

oam1.png

 

Select the line and go in the menu :

oam1.png

 

With Sales order you will have a popup like that, but with others transaction like Invoice you won't.

oam1.png

 

Double-click on the document will open you an internet browser :

oam1.png

Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>