Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting values out of functionmodule in functionmodule

0 Kudos
450

Hi experts,

I have a functionmodule in which the functionmodule "BAPI_GOODSMVT_CREATE" is used. From this functionmodule I now want to use the table "lt_item". Is there a way to get the table without changing the other functionmodule?

Thanks in advance.

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
400

Do you want to pass lt_item to the BAPI, which would be a basic abap question, or could you rephrase your requirement that I don't quite understand?

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
" ...
  TABLES
    goodsmvt_item                 = lt_item
" ...
Read only

AlexAdam
Product and Topic Expert
Product and Topic Expert
400

As Raymond mentioned it is not 100% clear what you are asking for.

Each function module has his own import and export parameters defined.
In the BAPI named above your table structure is based on structure BAPI2017_GM_ITEM_CREATE.

Therefore you need to map the table you get from BAPI_GOODSMVT_CREATE to your own format in different ways:

1) MOVE-CORRESPONDING for structure or table (if your own table uses the field names and DDIC elements

2) LOOP lt_item assigning <ls_item>.

ls_new-matnr = <ls_item>-material.
....
ENDLOOP.

There is no automatic mapping between FMs.

Read only

0 Kudos
400

alexander.adam , actually you can create a mapping FM between two structures (using the data element) look at transaction BDBS - Converting Between Int. and Ext. Data Formats and Structures (in SAP Library - BAPI Programmi...