2013 Apr 06 12:00 PM
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
2013 Apr 08 12:18 PM
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
2013 Apr 06 12:45 PM
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
2013 Apr 08 7:03 AM
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.
2013 Apr 08 11:08 AM
Hi Rithika,
Actually it is considering the T.Code--MCBE data.
i'l revert ASAP.
Rgds,
Krsihna
2013 Apr 08 11:19 AM
Hi Rithika ,
Actually it is considering the MCBE transaction code data. please debugge the program once then come to know.
Rgds,
Krishna
2013 Apr 08 12:04 PM
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.
2013 Apr 08 12:18 PM
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
2013 Apr 08 12:59 PM
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.
2013 Apr 08 3:22 PM
You couild
Regards,
Raymond
2013 Apr 09 7:19 AM
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.