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

Submit for MC.9

Former Member
0 Likes
1,705

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

6 REPLIES 6
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,075

Hi Ajay,

Just check this http://scn.sap.com/thread/2109358

Regards,

Madhu.

Read only

0 Likes
1,075

Hi Madhu

Will you please give me more details?

Regards

Ajay Goel

Read only

0 Likes
1,075

Hi Goel,

Just check this article to get data from alv report.

http://scn.sap.com/community/abap/blog/2011/07/07/gain-programmatic-access-to-data-of-sapgui-alv-rep...

Regards,

Madhu.

Read only

iftah_peretz
Active Contributor
0 Likes
1,075

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

Read only

0 Likes
1,075

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

Read only

0 Likes
1,075

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