Function Module to get all feild names in a structure

Hello Friends,
Is there a function module,where i give the structure name and get all the feild names within that structure.
regards
kaushik

Hi,
You can use the for run time type descriptor classes to do this :
Here is a simple example :
REPORT  z_assign_comp.
TYPE-POOLS : slis.
include <icon>.
"&   Dynamic Programming ! Using Structure Descriptior Class.          *
DATA: BEGIN OF line OCCURS 0,
        col1 TYPE i,
        col2(10) TYPE c,
        col3 TYPE i,
      END OF line.
FIELD-SYMBOLS : <fs> TYPE ANY.
FIELD-SYMBOLS : <itab_line> 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 <itab_line>.
"Call the static method of the structure descriptor describe_by_data
CALL METHOD cl_abap_structdescr=>describe_by_data
  EXPORTING
    p_data      = <itab_line>
  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->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 <fs>.
    WRITE :/ w_comp-name, ' ', <fs>.
  ENDLOOP.
ENDLOOP.
Hope this helps.
regards,
Advait

Similar Messages

  • Is there any function module for getting distribution list name

    Hi all,
    Is there any function module for getting distribution list name when there is same description for two distribution list name.
    or
    help me how to fetch the correct distribution name when there is same description.
    In order to send mails.
    Tell me ASAP.
    thanks
    sagar.

    http://www.sapbrainsonline.com/REFERENCES/FunctionModules/SAP_function_modules_list.html
    list of Fms

  • Any function module to get all items in SAP INBOX

    hi All
    I am trying to get all the items in my SAP Inbox via rfc.
    Can anyone help me with any function module to get all items in SAP INBOX.
    Thanks

    Hi Mukesh,
    Step 1. Use FM SO_USER_READ_API1 to get the folder details of the user
    Step 2. Use FM SO_FOLDER_READ_API1 of the respective folder. You can read the Inbox, Workflow Inbox depending on what folder you read. The function modules are documented well as well with examples.
    Hope this will  help u,
    Thanks & Regards
    Kiran

  • Function Module to get the node name in particular level name in Hierarchy

    Hi All,
    We have 0Material hierarchy which consists of 14 levels and materials are in the 14th level.
    We have a requirement to update the 4th level node name to all materials.
    So we have created the attribute to this 0Material and thought of updating in the transformation.
    Could you please suggest us to which function module i can in this scenario.
    Thanks in advance,..
    Prasanna

    Can you explain in more detail what exactly you want to do?
    do you want to limit hierarchy to level4?
    Regards
    Sudeep

  • Function module for getting all changes to BPs Business Partners for today

    Can any body knows function module to find out all changed documents to the BPs depending upon the date.
    Requirement is i have to find out the all BPs changed today in transaction FPP3.how can i find all those changed documents . Is there any FM to find out.
    Vineel

    Hi Vineel,
    For debugging: GoTo /n Click on the right most icon which is Customizing of local layout then click on create shortcut a screen will displayin that goto Application section select system command from the dropdown in Type, then write /h in command press OK a short cut will be automatically created on your desktop now drag this debugger on that pop up in TXn FPP3 and play with the debugger......
    Hope this will help..

  • Account Hierarchy : Function Module to get all the nodes of a hierarchy

    Hi Experts,
    Is there a function module which will give as output all the Node GUIDs for a particular account hierarchy in SAP CRM,when the Node GUID of any single node in the same tree is given as input?
    Best Regards,
    Ashish Dhagat

    Thanks mate.
    Edited by: pankaj kandhare on Aug 14, 2011 7:56 AM

  • Function module to get the month name when start date and end date given

    Hey Experts,
                       I am creating a employee bonus report. In this report each and every employee's month wise working days have to be calculated and displayed in the report. I need to find a function module which helps me split the given dates into that particular month. Please help me with the same.
    Regards,
    G. Shankar

    Hi Shankar,
    I think there are two Function Modules.
    First One is 'HR_RU_MONTH_NAME_IN_GENITIVE' in this u need to pass month number and for that u have extract month number from date.
    And Second One is 'ISP_GET_MONTH_NAME' in this u need to pass date or month number, it directly accepts date.
    Check this two and let me know.
    Cheers,
    Parth Parikh

  • DDIF Function Module for getting the description of a BAPI structure

    Hi,
    I need to find a function module that returns the description of a structure...well a BAPI structure, not that that makes any difference.
    The DDIF_ function modules I've tried will all return the descriptions of data elements in tables, but not structures.
    Thanks,
    Tristan

    Check FM : CACS_DBNAME2TABNAME

  • Function module for getting Vendor Address details

    Hi,
    Im new to this group,and new to ABAP
    plz hep me out by solving ABAP Query...
    i want to generate a report for getting Vendor Details
    like Vendor address,Ph num and Email
    input fields are Company code,country key and Account Group.
    im Using Smart Forms for this..
    but im not getting the Exact Function module to get All Required Details..
    regards
    Smitha

    thanks for ur quick reply...
    SELECT SINGLE LIFNR
      FROM LFB1
      INTO V_LIFNR
      WHERE BUKRS EQ V_BUKRS.
      CALL FUNCTION 'VENDOR_READ'
        EXPORTING
          i_bukrs         = V_BUKRS
          i_lifnr         = V_LIFNR
        EXCEPTIONS
         NOT_FOUND       = 1
         OTHERS          = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    this is the code i have written...
    but my problem is there no table in the Function module....
    for Example...
    CALL FUNCTION 'QPAX_PLMKB_READ_FROM_PLKO'
        EXPORTING
          i_plnty            = 'Q'
          i_plnnr            = V_PLNNR
          I_PLNAL            = V_PLNAL
          i_sttag            = V_DATUV
       TABLES
        T_PLMKB_TAB        = IT_TAB
    i want the function modules with tables and proper input...

  • Function module to get Pricing conditions of billing document

    Hi All,
    Please help me getting the pricing condition values for a billing document.  I got values from KONV table against perticular Condition type. but i need to get the values against step number maintained in Conditions for my billing item. is there any function module to get all condition data maintained in document with totals and discounts aswell.
    Please help me.  if required i will give tou full details what i required.
    Kumar.

    Hi Kumar,
    Please check below mentioned Function Module for details:
    RV_PRICE_PRINT_GET_BUFFER
    RV_PRICE_PRINT_GET_MODE
    RV_PRICE_PRINT_HEAD    (Header)
    RV_PRICE_PRINT_HEAD_BUFFER
    RV_PRICE_PRINT_ITEM       (Item)
    RV_PRICE_PRINT_ITEM_BUFFER
    RV_PRICE_PRINT_REFRESH
    Regards,
    Tutun

  • Function Module to get Active Serial Numbers of Material Stock

    Hi Experts,
    Do we have any function module to get all the active serial numbers of Material Stock? Or any suggestions on how to get these through SQL Queries?
    Thanks a lot for your help!

    GET_SERNOS_OF_DOCUMENT

  • Function module to get PRT for the operation in Maintenance Order

    Hi,
    Please tell me the function module to get PRT document for the all operation in Maintenance Order? and also tell me the FM to get all details of those PRT Docs so that I can Print those documents.
    Thanks.

    Hi,
    Please tell me the function module to get PRT document for the all operation in Maintenance Order in TCode IW31/32/33? and also tell me the Function Module to get all details of those PRT Documents so that I can take Print out of those documents.
    Thanks,
    Jay.

  • Function Module to get Equipments.

    Hi Experts,
         What is the function module to get all the equipments that uses the given material in SAP?
         Please provide me an answer.
    Thank you.

    Hi all,
         We found a Function module that suits my requirement.
         We can use
              1) CS_WHERE_USED_MAT
              2) CS_WHERE_USED_MAT_ANY
         Both will get in the Material Number and returns the list of Equipment that uses this material and the sub Materials too.
    Thank You.

  • Function Module to get Old materials

    Hello,
    Is there any function module to get all old materials for a material from MARA?? There can be many old materials for a material
    If not, What logic should I apply to get all old materials?
    Thank you.
    AP

    BISMIT will only give one lastest old material. But the this old material can have numerous other old materials.
    AP

  • Which Function Module can find all direct and indirect subordinate.

    Hi,
        I have a employee number(Chief of a organizational unit A). Do you know which function module can get all the direct and indirect subordinate of this chief? Indirect subordinate means that this chief can also view the Organizational unit(for example, Org. unit B) that under Org. Unit A. Further more, this chief can also view all the employees in other org unit that under Org. Unit B. If there is no such function module, do anyone of you have the example coding to get it? Your help is greatly appreciated. Thanks.

    use RH_STRUC_GET
    ~Suresh

Maybe you are looking for

  • ESB performance issue: takes too long to select and insert records in DBs

    Hi, I have an ESB service which has to select data from seven different tables(using join operations) of one database and insert it into a single table of another database. It takes unduly long time to do this operation. For ex: it takes over 2 hours

  • Export query result to csv using Export Wizard

    Been a decade since I last used Oracle and related tools. I had to use Oracle server again, I have a query over multiple tables, I am to run a scheduled script that will spit out the query result as a csv file. I started with SQL Developer Export wiz

  • Iphone 4 not turning on

    my phone stop working.  need help

  • IOS??

    what is iOS?

  • X6 full screen handwriting for Chinese language do...

    I bought Nokia X6 in Hong Kong 2 months ago, at that time I can use full screen handwriting for Chinese language. But after updating the SW I'm no longer able to use Chinese handwriting input. Help me please to offer me some advices on how to solve t