Skip to Content
0
Dec 29, 2022 at 01:16 PM

Create SAP Gateway using RFC Function Module-Map GetEntity and GetEntity set Method

121 Views

Ø Create a RFC Function Module using the below parameters.

Importing:

Sales Document

Exporting:

Sales Document,

Sales Org,

Delivery Block,

Net Value

Table:

Table type of the below structure

Sales Document

Sales Document Item

Material Number

Material Group

Ø Create SEGW project by importing RFC Function module, create two entity types

1. SalesDoc (For Exporting structure)

2. SalesItem (For Table)

I am using function module , here is the source code.

IF IP_VBELN IS NOT INITIAL.

SELECT SINGLE VBELN, VKORG, LIFSK, NETWR FROM VBAK INTO @DATA(LS_TAB)
WHERE VBELN = @IP_VBELN.

IF LS_TAB IS INITIAL.
EX_MSG = 'NO SALES DOCUMENT HEADER DATA FOUND'.
ENDIF.


EX_VBELN = LS_TAB-VBELN.
EX_VKORG = LS_TAB-VKORG.
EX_LIFSK = LS_TAB-LIFSK.
EX_NETWR = LS_TAB-NETWR.


SELECT VBELN, POSNR, MATNR, MATKL FROM VBAP INTO TABLE @OT_VBAP
WHERE VBELN = @IP_VBELN.

IF OT_VBAP[] IS INITIAL.
EX_MSG = 'NO SALES DOCUMENT LINE ITEM DATA FOUND'.
ENDIF.

ENDIF.

ENDFUNCTION.

now

when I am trying to GET the entity set created for header table fields from sap gateway client,

screenshot-9553.png

i am getting error.

but I am getting the output when i am trying to GET the item table output.

screenshot-9554.png


Kindly help me how to solve this issue.


Attachments