云服务器价格_云数据库_云主机【优惠】最新活动-搜集站云资讯

网站空间_全国高校数据库_优惠

小七 141 0

Contents

1.1         Issue:

1.2         Example.

1.3         Resolution Approach:

2.1         Step 1:

2.2         Step 2:

2.3         Step 3:

2.4         Step 4:

2.5         Step 5:

3.1         Step 1:

3.2         Step 2:

3.3         Step 3:

3.4         Step 4:

3.5         Step 5:

3.6         Step 6:

There is a requirement of attaching supporting documents whenever business users will create new credit-memo or debit memo request (Sales Order) in SAP system through the transaction VA01. While attaching those supporting documents following challenge must occur:

1.1  Issue:

SAP standard supports create/change/display/delete of attachments on VA02 and VA03 (change and display sales order respectively) transactions with the help of value ‘X’ on parameter ‘SD_SWU_ACTIVE’. There is no provision to attach/view attachment while credit memo requests are being created. Objective of this RICEF is to enable this attachment functionality for ‘create’ transactions also.

1.2  Example

For the Sales Order Creation screen (VA01), the GOS tool bar is not provided by standard SAP.

See screen shot below:

We will see below how we can activate the GOS toolbar using above class for transactions VA01/VA02/VA03

1.3  Resolution Approach:

To resolve the above issue, we can use a SAP provided toolbar "Generic Object services" or "GOS toolbar".

Following is the step by step instruction to use GOS Toolbar for resolving attachment issue.

2.1 Step 1: To activate it we need to do an enhancement in include ‘SAPMV45A’ inside form SP_TAGGING.

2.2 Step 2: Object key is required to activate the generic object services. Now object types for corresponding sales orders are as below:

Credit memo request (VA01/VA02/VA03) — BUS2094 Debit memo request (VA01/VA02/VA03) — BUS2096 Sales Order (VA01/VA02/VA03) — BUS2032

2.3 Step 3: The object key can be found out from the object type. Enter the object type in transaction ‘SWO1’

Click on display.

P.S: For above three Object types, object key is same and that is Sales Document.

2.4 Step 4:

CL_GOS_MANAGER is a standard SAP class available within R/3 SAP systems depending on the version and release level. It is useful to manage attachments on a report. It lets you upload and download files related any object inside your report. To activate CL_GOS_MANAGER, we need to create instance of the class first. This instance can be created by calling a constructor method. In the constructor method code, object type and object key need to be set as variable and passed through instance of the class. The code needs to be written either inside above implicit enhancement point

Following is the syntax:

DATA:   lr_gos_manager TYPE REF TO cl_gos_manager,              ls_borident    TYPE        borident.

STATICS lv_flag TYPE c.

IF sy-tcode = ‘VA01’ AND lv_flag  ‘X’.     CLEAR ls_borident.     CASE vbak-vbtyp.       WHEN ‘K’.                               "Credit memo request         ls_borident-objtype = ‘BUS2094’.       WHEN ‘L’.                               "Debit memo request         ls_borident-objtype = ‘BUS2096’.       WHEN ‘C’.                               "Orders         ls_borident-objtype = ‘BUS2032’.       WHEN OTHERS.         CLEAR ls_borident-objtype.     ENDCASE.

IF NOT ls_borident-objtype IS INITIAL.       CONCATENATE ‘ZGOSVA01’ sy-uname sy-datum sy-uzeit   INTO ls_borident-objkey.       EXPORT ls_borident-objkey TO MEMORY ID ‘ZGOSVA01’ .

CREATE OBJECT lr_gos_manager         EXPORTING           is_object        = ls_borident           ip_start_direct  = ‘ ‘           ip_no_commit     = ‘X’         EXCEPTIONS           object_invalid   = 1           callback_invalid = 2           OTHERS           = 3.       lv_flag = ‘X’.     ENDIF.

ENDIF.

[Here with the help of static variable (LV_FLAG), we are making sure that this piece of code will be triggered only once in an entire session of sales order creation. There was another challenge regarding object key. At this moment sales order number was not generated in SAP, so we have created a default unique key concatenating a text ‘ ZGOSVA01’ and username and date and time. We will use it later in our code]

2.5 Step 5: We have to attach that document to newly created sales order. So code needs to be added in user exit MV45AFZZ inside form USEREXIT_SAVE_DOCUMENT.

The Syntax is: