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

Field Symbols - Submit statement

Former Member
0 Likes
931

Hi All,

I need some help with field symbols.

I am submitting the program rm06em00 which has the output in ALV format. I used LIST_FROM_MEMORY and LIST_TO_ASCI which gets the data in ASCII format.

Instead of looping at the Acii table and then splitting at some offset to get the PO Number / Item/ Material, is there a way to read the internal table dynamically.

I know the output structure of the internal table (ALV). The output structure is MEREP_OUTTAB_PURCHDOC.

I can define internal table (ITAB1) like MEREP_OUTTAB_PURCHDOC locally in my program and then loop at the ascii table and move data to the ITAB1. I tried using field symbols , but could not get it to work.

Please advice.

Thanks.

Hi All,

I need some help with field symbols.

I am submitting the program rm06em00 which has the output in ALV format. I used LIST_FROM_MEMORY and LIST_TO_ASCI which gets the data in ASCII format.

Instead of looping at the Acii table and then splitting at some offset to get the PO Number / Item/ Material, is there a way to read the internal table dynamically.

I know the output structure of the internal table (ALV). The output structure is MEREP_OUTTAB_PURCHDOC.

I can define internal table (ITAB1) like MEREP_OUTTAB_PURCHDOC locally in my program and then loop at the ascii table and move data to the ITAB1. I tried using field symbols , but could not get it to work.

Please advice.

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
719

Hi ,

i think you need to do manually..

Try this way...



  SUBMIT rkaep000
     USING SELECTION-SET 'BPC TEST'
           EXPORTING LIST TO MEMORY AND RETURN.     "First export list to memory

* Read list from memory into table
  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = lt_listobject .

*Spool content in Ascii format
  CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
      listobject         = lt_listobject
      listasci           = txtlines .

  CALL FUNCTION 'LIST_FREE_MEMORY'
    TABLES
      listobject = lt_listobject.


  LOOP AT txtlines.
    txtlines = txtlines+1(1023).
    SPLIT txtlines AT '|' INTO          itab-field1 . . . .Itab-field60
    IF itab-field1 CA sy-abcde OR itab-field1 = ' '.
    ELSE.
      APPEND itab.
      CLEAR itab.
    ENDIF.
 ENDLOOP.

Prabhu

Read only

0 Likes
719

Hi Prabhu,

I could have used split but the target structure has 30 fields and I don't want to hardcode the fields. Was wondering if there is a way to dynamically populate the internal table.

Thanks.

Read only

Former Member
0 Likes
719

Hi

The field-symbol is just a pointer, so it allows to link to certain area of memory: that means the data u need to get has to be loaded in memory.

After exiting from a submit of a report, I believe all memory area for that report will be cleared: so it's useless to use the field-symbols.

In this situation u should export the data to memory in the called report and then import it from memory in the calling report.

The report is standard and u can't change it, but if your release is ECC 6.00 u can try to use a spot enanchement to do that.

Max