<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mapping BAPI-structure-field to its internal component in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mapping-bapi-structure-field-to-its-internal-component/m-p/4548159#M1074084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guru,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm building a function builder that should transform any structure- or table-field to its corresponding component in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA-MATERIAL should be transformed in MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My priority is concentrated by BAPI_MATERIAL_GETALL.&lt;/P&gt;&lt;P&gt;I should MAP all the structure or table fields to their corresponding internal element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA should be mapped to MARA&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA-MATERIAL should be mapped to MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kais&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Sep 2008 12:39:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-24T12:39:30Z</dc:date>
    <item>
      <title>Mapping BAPI-structure-field to its internal component</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mapping-bapi-structure-field-to-its-internal-component/m-p/4548159#M1074084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guru,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm building a function builder that should transform any structure- or table-field to its corresponding component in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA-MATERIAL should be transformed in MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My priority is concentrated by BAPI_MATERIAL_GETALL.&lt;/P&gt;&lt;P&gt;I should MAP all the structure or table fields to their corresponding internal element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA should be mapped to MARA&lt;/P&gt;&lt;P&gt;BAPI_MARA_GA-MATERIAL should be mapped to MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kais&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 12:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mapping-bapi-structure-field-to-its-internal-component/m-p/4548159#M1074084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-24T12:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping BAPI-structure-field to its internal component</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mapping-bapi-structure-field-to-its-internal-component/m-p/4548160#M1074085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Try to use the class CL_ABAP_STRUCTDESCR and its methods.&lt;/P&gt;&lt;P&gt;Take a look at the example below :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  z_assign_comp.

*&amp;amp;   Dynamic Programming ! Usign Structure Descriptior Class.          *

DATA: BEGIN OF line OCCURS 0,
        col1 TYPE i,
        col2(10) TYPE c,
        col3 TYPE i,
      END OF line.

FIELD-SYMBOLS : &amp;lt;fs&amp;gt; TYPE ANY.

FIELD-SYMBOLS : &amp;lt;itab_line&amp;gt; TYPE ANY.


DATA : BEGIN OF t_comp OCCURS 0,
        comp(5) TYPE c,
       END OF t_comp.

DATA : l_struc TYPE REF TO cl_abap_structdescr.
DATA : l_typedesc TYPE REF TO cl_abap_typedescr.
DATA : lt_comp TYPE abap_compdescr_tab,
       w_comp LIKE LINE OF lt_comp.


line-col1 = 11.line-col2 = 'SAP'.line-col3 = 33.
APPEND line.

line-col1 = 44.line-col2 = 'P.I.'.line-col3 = 66.
APPEND line.

ASSIGN line TO &amp;lt;itab_line&amp;gt;.


*Call the static method of the structure descriptor describe_by_data
CALL METHOD cl_abap_structdescr=&amp;gt;describe_by_data
  EXPORTING
    p_data      = &amp;lt;itab_line&amp;gt;
  RECEIVING
    p_descr_ref = l_typedesc.

*The method returns a reference of  a type descriptor class therefore we
*need to Cast the type descriptor to a more specific class i.e
*Structure Descriptor.
l_struc ?= l_typedesc.

*Use the Attribute COMPONENTS of the structure Descriptor class to get
*the field names of the structure
lt_comp = l_struc-&amp;gt;components.

LOOP AT line.

  WRITE :/ 'Row : ', sy-tabix.

  LOOP AT lt_comp INTO w_comp.

*   Using the ASSIGN component ,assigns a data object to a field symbol.

    ASSIGN COMPONENT w_comp-name OF STRUCTURE line TO &amp;lt;fs&amp;gt;.
    WRITE :/ w_comp-name, ' ', &amp;lt;fs&amp;gt;.

  ENDLOOP.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be a pointer to your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 13:05:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mapping-bapi-structure-field-to-its-internal-component/m-p/4548160#M1074085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-24T13:05:48Z</dc:date>
    </item>
  </channel>
</rss>

