<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: call tcode KSB1 in a custom program and modify its output in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624998#M1280990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this code it will work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the data is stored in txtlines format the data by the field wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* 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 &amp;amp;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.
 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on May 20, 2009 11:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 17:55:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-20T17:55:49Z</dc:date>
    <item>
      <title>call tcode KSB1 in a custom program and modify its output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624997#M1280989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have already done this before, please elaborate on the steps how you achieved it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is what I am doing but it gives the same error as one of you had - transaction code not defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: FCODE TYPE SY-TCODE VALUE 'KSB1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUBMIT RKAEP000 WITH SY-TCODE = FCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shipra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 17:53:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624997#M1280989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T17:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: call tcode KSB1 in a custom program and modify its output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624998#M1280990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this code it will work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the data is stored in txtlines format the data by the field wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* 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 &amp;amp;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.
 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on May 20, 2009 11:28 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 17:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624998#M1280990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T17:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: call tcode KSB1 in a custom program and modify its output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624999#M1280991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i pass the tcode (ksb1) with the program call?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:01:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5624999#M1280991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T18:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: call tcode KSB1 in a custom program and modify its output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5625000#M1280992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to fetch the pgm name for the t-code from table tstc and submit with report name...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single pgmname from TSTC where t-code = 'KSB1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;submit pgmname and return..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:05:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5625000#M1280992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T18:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: call tcode KSB1 in a custom program and modify its output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5625001#M1280993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I let the program RKAEP000 which is called from my custom program know that the tcode to be processed is KSB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-tcode-ksb1-in-a-custom-program-and-modify-its-output/m-p/5625001#M1280993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T18:13:43Z</dc:date>
    </item>
  </channel>
</rss>

