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

Mapping of fields between dictionary structure(MARC) and BAPI structure(BAPIE1MARC)

Former Member
0 Likes
1,778

Hi experts,

I have some issue regarding to field mapping between dictionary structure and bapi structure. So basically here is the problem, the problem lies between structure MARC and BAPIE1MARC.

DATA: lwa_plantdata TYPE bapie1marc.

          wmarc TYPE marc.

So, I want to move-corresponding(mapping) fields between these 2 structures, but I cannot use MOVE-CORRESPONDING syntax as fieldname are different between a BAPI structure and standard structure in dictionary. Furthermore, this is happen in a dynamic condition and below is part of the codes in which I want to extend the material to various plants using BAPI_MATERIAL_SAVEREPLICA.

Any idea on how to achieve this particularly on what I want to do in the arrow line?

*           Loop at each extended plant

             LOOP AT lt_werks INTO lwa_werks.

*             Populate plant info

               lwa_plantdata-function = lc_upd.

               lwa_plantdata-material = wmarc-matnr.

               lwa_plantdata-plant    = lwa_werks-werks.

               LOOP AT lt_tab_fieldname INTO lwa_tab_fieldname. "defined fields

                 ASSIGN lwa_tab_fieldname-fieldname_ext TO <lfs_fieldname>. "will store the fieldname which refer to MARC

                 ASSIGN COMPONENT <lfs_fieldname> OF STRUCTURE wmarc TO <lfs_fieldval>.

----------------> "lwa_plantdata-<CORRESPONDING FIELD NAME WHICH REFER TO WMARC field> = <lfs_fieldval>.

               ENDLOOP.

               APPEND lwa_plantdata TO lt_plantdata.

               lwa_plantdatax-function = lc_upd.

               lwa_plantdatax-material = wmarc-matnr.

               lwa_plantdatax-plant    = lwa_werks-werks.

               LOOP AT lt_tab_fieldname INTO lwa_tab_fieldname.

               ENDLOOP.

               APPEND lwa_plantdatax TO lt_plantdatax.

             ENDLOOP.

Hi experts,

I have some issue regarding to field mapping between dictionary structure and bapi structure. So basically here is the problem, the problem lies between structure MARC and BAPIE1MARC.

DATA: lwa_plantdata TYPE bapie1marc.

          wmarc TYPE marc.

So, I want to move-corresponding(mapping) fields between these 2 structures, but I cannot use MOVE-CORRESPONDING syntax as fieldname are different between a BAPI structure and standard structure in dictionary. Furthermore, this is happen in a dynamic condition and below is part of the codes in which I want to extend the material to various plants using BAPI_MATERIAL_SAVEREPLICA.

Any idea on how to achieve this particularly on what I want to do in the arrow line?

*           Loop at each extended plant

             LOOP AT lt_werks INTO lwa_werks.

*             Populate plant info

               lwa_plantdata-function = lc_upd.

               lwa_plantdata-material = wmarc-matnr.

               lwa_plantdata-plant    = lwa_werks-werks.

               LOOP AT lt_tab_fieldname INTO lwa_tab_fieldname. "defined fields

                 ASSIGN lwa_tab_fieldname-fieldname_ext TO <lfs_fieldname>. "will store the fieldname which refer to MARC

                 ASSIGN COMPONENT <lfs_fieldname> OF STRUCTURE wmarc TO <lfs_fieldval>.

----------------> "lwa_plantdata-<CORRESPONDING FIELD NAME WHICH REFER TO WMARC field> = <lfs_fieldval>.

               ENDLOOP.

               APPEND lwa_plantdata TO lt_plantdata.

               lwa_plantdatax-function = lc_upd.

               lwa_plantdatax-material = wmarc-matnr.

               lwa_plantdatax-plant    = lwa_werks-werks.

               LOOP AT lt_tab_fieldname INTO lwa_tab_fieldname.

               ENDLOOP.

               APPEND lwa_plantdatax TO lt_plantdatax.

             ENDLOOP.

3 REPLIES 3
Read only

Former Member
0 Likes
1,193

any idea anyone?

Read only

Former Member
0 Likes
1,193

You could try to use MAP2I_BAPI_MARC_TO_MARC_UEB.

1. Move-corresponding lwa_plantdata to FM importing structure BAPI_MARC

2. call the FM

3. Move-corresponding MARC_UEB to wmarc.

Hope this helps.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,193

Perform a where-used on BAPI structure,  you may find a MAP* FM to map corresponding data, when none found, transaction BDBS can help you to generate a Z-mapping FM.

Read documentation like Converting Between Int. and Ext. Data Formats and Structures.

Regards,

Raymond