Application Development 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: 

Submit MC.9 and get the total ValStockValue

former_member224444
Participant

Dear All,

I am developing a report, for which i need to get the closing stock as per the plant for previous month. Easy way is to use submit. so i used submit. My problem i am getting Columns such as as per material but am not able to see the field ValStockValue whereas i can see this column in when i run MC.9 manually.

Am getting three different columns when i debug and see the internal table which i got using Submit. What should i do to get the above column in my Submit.

My Coding:

SUBMIT RMCB0300

                   WITH SL_WERKS IN R_WERKS

                   WITH SL_MTART IN R_MTART

                  WITH SL_SPMON IN R_SPMON 

                   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(3072) 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.



I am getting below values in textlines

But I need column ValStockValue, it is not getting displayed in the above internal table, below is screenshot of MC.9

Please tell me what will be the problem.

Regards,

Rithika

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

If you debug/look at source of this report you will find a select using SY-TCODE (Table TMCTC in form variablen_initialisieren of include RMCB01F0)

Regards,

Raymond

9 REPLIES 9

krishna_k19
Contributor
0 Kudos

Dear Rithika,

     Instead of textline pls mention the Table name what they mentioned in MC.9 then you wil get correct result. pls check nd revert.

call function 'LIST_TO_ASCI'

   tables

   listobject = ABAPLIST

   listasci = textlines

   exceptions

   empty_list = 1

   list_index_invalid = 2

   others = 3.

Rgds,

Krishna

0 Kudos

Dear Krishna,

As you said i have mentioned the table name what they have mentioned in MC.9,

DATA INT_S000(1024) TYPE C OCCURS 0 WITH HEADER LINE.


call function 'LIST_TO_ASCI'

   tables

   listobject = ABAPLIST

   listasci = INT_S000

   exceptions

   empty_list = 1

   list_index_invalid = 2

   others = 3.

But still i cannot see the column what i need in the INT_S000.

Regards,

Rithika.

0 Kudos

Hi Rithika,

        Actually it is considering the T.Code--MCBE data.

i'l revert ASAP.

Rgds,

Krsihna

0 Kudos

Hi Rithika ,

     Actually it is considering the MCBE transaction code data. please debugge the program once then come to know.

Rgds,

Krishna

0 Kudos

Dear Krishna,

I have debugged and saw the program RMCB0300 which is assigned to MC.9. I can't find what is going wrong why it is showing unwanted columns.

Regards,

Rithika.

raymond_giuseppi
Active Contributor

If you debug/look at source of this report you will find a select using SY-TCODE (Table TMCTC in form variablen_initialisieren of include RMCB01F0)

Regards,

Raymond

0 Kudos

Dear Raymond,

Thanks for your clue. Actually i debugged and saw the subroutine variablen_initialisieren.  I have noticed that sy-tcode in the query SELECT SINGLE * FROM tmctc  WHERE tcode = sy-tcode is taking SE38 when i call the RMCB0300 using Submit, so in debugging mode i have changed the value of sy-tocde to MC.9 and checked,  this time it is showing correct columns what i want, but am not getting the values in the column, 

Anyway this time it is showing the columns what i want, but how to change the value of sy-tcode to MC.9 when i call the program using SUBMIT. Is there any option to do that.

Regards,

Rithika.

0 Kudos

You couild

  • Add your own transaction code to table TMCTC,
  • Go to implicit enhancement in the form.
  • Trace the report execution via SAT/SE30 and find a better access point
  • etc.

Regards,

Raymond

0 Kudos

Dear Raymond,

Thanks for your help. My issue got solved. As i told if i change the value of sy-tcode to 'MC.9' in the   query SELECT SINGLE * FROM tmctc  WHERE tcode = sy-tcode of the standard program RMCB0300  i am getting the columns what i need, so i have created a 'z' program from 'RMCB0300'  and assigned 'MC.9' in the query as follows

SELECT SINGLE * FROM tmctc  WHERE tcode = 'MC.9'. And used Submit to the z program like

SUBMIT ZRMCB0300 "USING "SELECTION-SCREEN 1000

                   WITH SL_WERKS IN R_WERKS

                   WITH SL_SPMON IN R_SPMON

*                   with sl_matnr in r_matnr

                   WITH SL_MTART IN R_MTART

                   AND RETURN   EXPORTING LIST TO MEMORY.


Now am getting columns and values what i need from my submit.

Regards

Rithika.