2009 May 20 6:53 PM
I was searching the forum for finding a way to create a program that has all details from KSB1 and some details from CJ13 (WBS details) and found some related posts. But none of the posts had any details on how to actually achieve this.
I have to do a similar thing of getting the KSB1 output and add WBS details for each line item and then give the final output.
If you have already done this before, please elaborate on the steps how you achieved it.
Please specify the SUBMIT that you had written to call KSB1. If I can have all details from KSB1 in my memory, then I can read that in my program and add WBS details and give the output.
Below is what I am doing but it gives the same error as one of you had - transaction code not defined.
DATA: FCODE TYPE SY-TCODE VALUE 'KSB1'.
SUBMIT RKAEP000 WITH SY-TCODE = FCODE.
Any help would be appreciated. Thanks.
Regards,
Shipra
I was searching the forum for finding a way to create a program that has all details from KSB1 and some details from CJ13 (WBS details) and found some related posts. But none of the posts had any details on how to actually achieve this.
I have to do a similar thing of getting the KSB1 output and add WBS details for each line item and then give the final output.
If you have already done this before, please elaborate on the steps how you achieved it.
Please specify the SUBMIT that you had written to call KSB1. If I can have all details from KSB1 in my memory, then I can read that in my program and add WBS details and give the output.
Below is what I am doing but it gives the same error as one of you had - transaction code not defined.
DATA: FCODE TYPE SY-TCODE VALUE 'KSB1'.
SUBMIT RKAEP000 WITH SY-TCODE = FCODE.
Any help would be appreciated. Thanks.
Regards,
Shipra
2009 May 20 6:55 PM
Hi,
try this code it will work..
the data is stored in txtlines format the data by the field wise.
* Data Declaration
DATA:lt_listobject TYPE TABLE OF abaplist,
l_tab_lines TYPE i.
DATA: txtlines(1024) TYPE c OCCURS 0 WITH HEADER LINE.
SUBMIT rkaep000 "the program name
USING SELECTION-SET 'BPC TEST' "Pass varint BPC Test
EXPORTING LIST TO MEMORY AND RETURN.
* Read list from memory into table
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc 0.
* Error in function module &1
ENDIF.
*Spool content in Ascii format
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listobject = lt_listobject
listasci = txtlines
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
CALL FUNCTION 'WRITE_LIST' "Display report same as in KSB1... else not required
TABLES
listobject = lt_listobject
EXCEPTIONS
empty_list = 1
OTHERS = 2.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = lt_listobject.
LOOP AT txtlines. "data will be stored in this..
" split the txtlines-tdline with | and move into another internal table and do the validation...
endloop.
Prabhudas
Edited by: Prabhu Das on May 20, 2009 11:28 PM
2009 May 20 7:01 PM
The problem with this program is that it caters to several (about 15 odd trasactions). hence we need to define the tcode that is calling this program , else the error - Transaction code not defined pops up and the program ends.
How do i pass the tcode (ksb1) with the program call?
2009 May 20 7:05 PM
hi.
try to fetch the pgm name for the t-code from table tstc and submit with report name...
select single pgmname from TSTC where t-code = 'KSB1'.
submit pgmname and return..
Prabhudas
2009 May 20 7:13 PM
Hello again,
Thanks for that, but I already know the program is RKAEP000 and this standard program is called for several trasactions. I need to call KSB1.
How do I let the program RKAEP000 which is called from my custom program know that the tcode to be processed is KSB1.
Thanks.
P.S: There are posts from two people on this forum relating the same issue, sometime in the past but that does not specify how they achieved it.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |