2012 Sep 28 5:44 AM
Hi
I am creating one program in which i want to use Submit statement to get the output from MC.9. Now i am not able to take the output in internal table. Please suggest. Please see the code.
SUBMIT RMCB0300 VIA SELECTION-SCREEN
WITH SL_MATNR IN S_MATNR
WITH SL_WERKS IN S_WERKS
WITH SL_MTART IN S_MTART
WITH SL_MATKL IN S_MATKL
WITH SL_SPTAG IN S_BUDAT AND RETURN
EXPORTING LIST TO MEMORY .
IMPORT IT_DATA = IT_DATA FROM MEMORY ID 'DATA'.
Please suggest how can i take the output in my internal table with Material code, Description , Stock Quantity and Value.
Regards
Ajay Geol
2012 Sep 28 6:30 AM
2012 Sep 28 11:16 AM
Hi Madhu
Will you please give me more details?
Regards
Ajay Goel
2012 Sep 28 11:42 AM
Hi Goel,
Just check this article to get data from alv report.
Regards,
Madhu.
2012 Sep 28 12:58 PM
Hi Ajay,
This will work, textlines will contain the list (same as outputted to screen):
SUBMIT RMCB0300 VIA SELECTION-SCREEN
WITH SL_MATNR IN S_MATNR
WITH SL_WERKS IN S_WERKS
WITH SL_MTART IN S_MTART
WITH SL_MATKL IN S_MATKL
WITH SL_SPTAG IN S_BUDAT AND RETURN
EXPORTING LIST TO MEMORY .
check sy-subrc eq 0.
DATA: ABAPLIST LIKE ABAPLIST OCCURS 0.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ABAPLIST
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
DATA textlines(1024) TYPE C OCCURS 0 WITH HEADER LINE.
call function 'LIST_TO_ASCI'
tables
listobject = ABAPLIST
listasci = textlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
Make the needed adjustments and get your data from textlines to your own table.
Best,
Iftah
2012 Sep 30 4:49 AM
Hi Iftah
Thanks for your valuable reply but please give me more details that how can I get material code, quantity and value from the text line?
Regards
Ajay Goel
2012 Sep 30 8:33 AM
Hi Iftah
Now I have taken data from text line to internal table but in internal teble i am getting the fields 'Received Stk Qty' and 'Issues Stk Qty' instead of closing stock and closing value. I think the program for MC.A and MC.9 is same so when i execute the program thru submit then it is running MC.A because Received stock and Issued Stock are the fields of MC.A.
So please guide me how can i take the desired fields Closing stock and value when i am running
RMCB0300 program.
Regards
Ajay Goel