06-13-2017 12:23 PM
Hello,
I am submitting MB51 and returning list to memory.
Next i am using FM: LIST_FROM_MEMORY to get data and finally using
FM: LIST_TO_ASCI to get it into an internal table.
But, this way, data returned in internal table is in a single column. i.e of type text.
Is there a way that i can get data in individual columns ?
Thanks in advance.
Regards,
Rahul
06-13-2017 12:35 PM
No - you need to parse the result into your table.
06-13-2017 1:27 PM
Either you parse/split the data into TWO internal tables (header and detail, REUSE_ALV_HIERSEQ_LIST_DISPLAY) or disguise as MIGO to trigger an export of data and prevent display:
EXPORT flag = 'X' TO MEMORY ID 'MB51_FLAG'.
EXPORT no_list = 'X' TO MEMORY ID 'MB51_NOLIST'.
" submit RM07DOCS or call transaction 'MB51'
IMPORT export_list = lt_list FROM MEMORY ID 'MB51_EXPORT_LIST'.
Look in RM07DOCS or LMIGOSR1 for export_list itab definition.
06-14-2017 5:55 AM
Hi Rahul,
Try something like below,
Thanks,
Sijin
06-14-2017 6:17 AM
Try Using below code you will get data in <lt_pay_data>:
DATA : i_selection TYPE STANDARD TABLE OF rsparams ,
lr_pay_data TYPE REF TO data ,
REFRESH : i_selection[] .
CLEAR : wa_selection.
wa_selection-selname = 'MATNR'.
wa_selection-kind = 'S'.
wa_selection-sign = 'I'.
wa_selection-option = 'BT'.
wa_selection-low = '1000000' .
wa_selection-high = '99999999' .
APPEND wa_selection TO i_selection.
CLEAR wa_selection.
CLEAR : wa_selection.
wa_selection-selname = 'NOZERO'.
wa_selection-kind = 'P'.
wa_selection-low = 'X' .
APPEND wa_selection TO i_selection.
CLEAR : wa_selection.
wa_selection-selname = 'PA_FLT'.
wa_selection-kind = 'P'.
wa_selection-low = 'X' .
APPEND wa_selection TO i_selection.
CLEAR wa_selection.
wa_selection-selname = 'PA_HSQ'.
wa_selection-kind = 'P'.
wa_selection-low = '' .
APPEND wa_selection TO i_selection.
CLEAR wa_selection.
wa_selection-selname = 'PA_SOND'.
wa_selection-kind = 'P'.
wa_selection-low = 'X' .
APPEND wa_selection TO i_selection.
CLEAR wa_selection.
CLEAR : wa_selection.
wa_selection-selname = 'P_VARI'.
wa_selection-kind = 'P'.
wa_selection-low = 'MONTH_END' .
APPEND wa_selection TO i_selection.
CLEAR wa_selection.
FIELD-SYMBOLS : <lt_pay_data> TYPE ANY TABLE ,
<ls_pay_data> TYPE ANY.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
* Submit MB52
SUBMIT rm07mlbs
WITH SELECTION-TABLE i_selection
AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_pay_data ).
IF lr_pay_data IS NOT INITIAL.
ASSIGN lr_pay_data->* TO <lt_pay_data>.
IF <lt_pay_data> IS ASSIGNED.
PERFORM convert_data.
PERFORM write_file_to_app USING p_filename.
CLEAR : lr_pay_data.
REFRESH : <lt_pay_data>[].
ENDIF.
ENDIF.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).