Call tcode KSB1 in a custom program and modify its output

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

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

Similar Messages

  • Calling the standard program in program and getting its output in int table

    Hi there,
    I have a requirement, where I need to call the standard program (of transaction CJI3) in my Y program. CJI3 transaction produces a ALV GRID output. I need to use that data for further processing. I am getting following problems:
    1. I tried to use SUBMIT ... EXPORTING TO MEMORY statement. I need to pass the company code for the selection, but the company code is in the dynamic selection. So not getting how to pass them.
    2. Just a doubt. Can we export the ALV GRID to the memory an retrieve it back using import?
    3. I did tried to use SUBMIT .....  statement using only the parameters which are on the selection screen. However the control went to CJI3 transaction and gave an error message 'Please select "from database" or "from archive" '. Did not understood that, any IDEA?
    Or is there any other way with which I can accomplish my requirement of getting the data in my program to manipulate, other than SUBMIT.
    Points will be rewarded.
    Thanks,
    Ganesh Khumse

    Hi,
    point 1:
    SUBMIT ... EXPORTING TO MEMORY will never work, because it displays the information in an ALV grid and that grid is waiting for user interaction for manipulating the information.
    point 2:
    no, you cannot export the content of an ALV grid to the memory
    point 3:
    must you get records in an internal table or must you feed the transaction, so that this one performs a task ??  for first option read below and for the other option you might work with BDC and Transaction Recorder.
    what you have to do is read the code of transaction CJI3 in order to understand what it does, where the information is read from and what is the internal table that passes the values to the ALV Grid. You might find a user exit in the code for manipulating that information or you might create an enhancement point if there´s no user exit.

  • Upload file in custom program and pass it to workflow

    Hi, guys.  Now, i have the requirment to allow user to upload file in the custom program and trigger the workflow with the attached file.
    Any one has experience on this? i would like to know how to upload the file from custom program, and how to create instance of the BO "SOFM".  Then, i can pass this instance to workflow.

    HI Jrockman,
    Please check the solved reply in this thread
    Passing a file from a report  to workflow container
    Hope this would solve your issue.
    Good luck
    Narin

  • Custom overlays and modifying Safe Margins?

    Hi folks,
    I had a quick question and haven't been able to find proper information when researching... but would creating custom overlays and modifying the safe margin be theoretically possible within the SDK? If so what approach would be taken to do so?
    If there is documentation on creating things such as this, and I've missed it, I apologize for wasting your time - however pointing me in the right direction would be much appreciated!
    Thanks in advance.

    Hi Ian,
    You can modify the Safe Margin in the Project Settings > General > Action and Title Safe Areas.
    There's no plug-in type for creating custom overlays for the Source and Program Monitors.  I'm not sure what your idea is, but perhaps could achieve something similar using an effect plug-in.  Effect plug-ins built using the After Effects SDK can have "Custom Composition UI", so that when the effect is applied to a clip and its header is selected in the Effect Controls Panel, it can draw over the video in the Monitor.  You could create an adjustment layer and apply the effect to that clip, so that you could have an overlay over the entire timeline.

  • How to execute some code in command line, and read its output?

    I'v found here http://www.sap-advisor.com/abap-coding/how-to-execute-operating-system-commands-from-within-sap/ that I can execute commands from the windows command line for example inside SAP.
    But I want to take it one step further and read its output. is it possible?

    Hi RagnaRock,
    one possible approach can be outputting the results of the command into a text file (i.e. "command >result.txt"), and then read this file from SAP/ABAP.
    I hope this helps. Kind regards,
    Alvaro

  • Printing Purchase Order from ME9F using custom program and smartform

    I was able to use my custom program which calls a smartform to print purchase orders from transaction ME9F. I did this using transaction NACE.
    However, when I call "Output Message" from ME9F, the output always fails (shown by an 'X' icon after the checkbox). When I try to put back the standard program in NACE, it does not show an 'X' but a check which indicates that the printing was successful.
    Do you know why this happens? What did I miss?
    Here's my call to my smartform from my custom driver program:
        " Change Smartform ZP_MMSF_P01_PURCHASE_ORDER
        " to internal Function module name
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
                FORMNAME   = 'ZP_MMSF_P01_PURCHASE_ORDER'
            IMPORTING
                FM_NAME    = fmname
        wa_cparam-no_dialog = 'X'.
        wa_output-tddest = 'LOCL'. "or 'LP01'.  "Spool: Output device
        CALL FUNCTION fmname
            EXPORTING
                control_parameters         = wa_cparam
                output_options             = wa_output
                i_data                     = i_data
                wa_lookup                  = wa_data_lookup
                goods_amt                  = goods_amt
                discount_amt               = discount_amt
                vat                        = vat
                total_amt                  = total_amt
                total_amt_inwords          = total_amt_inwords

    Vijaya,
    I have this problem though,
    Whenever I try to provide values for CONTROL_PARAMETERS and OUTPUT_OPTIONS to the sapscript call in your code, the PO printing (even the preview) does not proceed. I do this because I wanted to suppress the printer dialog.
    here is a fragment of the code:
    " code I added
    LS_COMPOSER_PARAM-tddest = 'LOCL'. "or 'LP01'.  "Spool: Output device
    LS_COMPOSER_PARAM-bcs_langu = sy-langu.
    LS_CONTROL_PARAM-preview = 'X'.
    LS_CONTROL_PARAM-no_open = 'X'.
    LS_CONTROL_PARAM-no_close = 'X'.
    LS_CONTROL_PARAM-device = 'PRINTER'.
    LS_CONTROL_PARAM-no_dialog = 'X'.
    DO NAST_ANZAL TIMES.
    *--In case of repetition only one time archiving
    * if sy-index > 1 and nast-tdarmod = 3.
    * nast_tdarmod = nast-tdarmod.
    * nast-tdarmod = 1.
    * ls_composer_param-tdarmod = 1.
    * endif.
    IF SY-INDEX NE 1 AND REPEAT IS INITIAL.
    REPEAT = 'X'.
    ENDIF.
    CALL FUNCTION LF_FM_NAME
    EXPORTING
    ARCHIVE_INDEX = TOA_DARA
    ARCHIVE_PARAMETERS = ARC_PARAMS
    CONTROL_PARAMETERS = LS_CONTROL_PARAM
    MAIL_RECIPIENT = LS_RECIPIENT
    MAIL_SENDER = LS_SENDER
    OUTPUT_OPTIONS = LS_COMPOSER_PARAM
    USER_SETTINGS = SPACE
    IS_NAST = NAST
    IS_REPEAT = REPEAT
    I tried to trace it to the function module generated by smartform. The error propagates this way: From the function module, there is a call to function SSFCOMP_PROCESS_DOCUMENT. Then inside that function, there is a perform operation to tr_ssfcomp_process_doc
    perform tr_ssfcomp_process_doc using startpage docstruc
                                           header.
    Inside that form, it calls the macro tr_active which checks the value of ssfcstat-trlevel (tracelevel) against c_trlevel_document. In the macro, if ssfcstat-trlevel is less than c_trlevel_document, the smartform will fail. c_trlevel_document is 15 and ssfcstat-trlevel is 0, and so the smartform fails.
    (you can see the macro tr_active in include LSTXBCMAC and the form tr_ssfcomp_process_doc is in the include LSTXBCFTR)
    When I do not put values in CONTROL_PARAMETERS and OUTPUT_OPTIONS, everything is ok.
    Do you know why this happens?
    Thanks in advance!
    Edit: I have found out about transaction SFTRACE, but this is disabled.
    Kyle

  • How to call BOR object- method in custom program

    hi all,
    I have the following details:
    BOR object : INSTLN
    Method: createdirect
    I need to call the above method in my custom program.
    I need to call it entirely. Means if it contains fn modules I dont want to call those fn modules seperately.

    Hi Sammy,
    Phil Soady from SAP Australia provided me with this little gem a few years back. The actual documentation for this can be found somewhere in the workflow programming area, but I just looked and couldn't find it for you. Anyway, this is a sample program I built to show how to do this. In this example I call the Display method of the Sales Document BO.
    INCLUDE <cntn02>.
    INCLUDE <cntn03>.
    FUNCTION zcallbomethod.
    *"*"Local interface:
    * Data declaration
      DATA: vbak_ref TYPE swc_object.
    * Declare and initialise container
      swc_container container.
      swc_create_container container.
    * Create object reference to sales document
      swc_create_object vbak_ref 'VBAK' '0000000009'. "Sales Document Number
    * Call Display
      swc_call_method vbak_ref 'Display' container.
    * Error handling
      IF sy-subrc NE 0.
      ENDIF.
    ENDFUNCTION.
    Cheers
    Graham Robbo

  • Calling another program and waiting for output

    Hi,
    I'm writing a program that passes a file created for an application called Net Sim but has to wait for the output. Net Sim lies in another directory from the java files and I don't know how to call the program with the file created as a parameter, such as:
    ns2 network1.tcl
    where 'ns2' is the dos command to run net sim and 'network1.tcl' is a file passed as a parameter to the program.
    I've tried
    try{
    Runtime r = Runtime.getRuntime();
    r.exec(" <directory> ");
    }catch(IOException e){
    System.out.println("Error " +e);
    This doesn't work though and I could use some help, as well as how to save the file created by the program in another directory.
    Finally, I need to know how to make the program wait for the output from net sim which is a file I intend to use. Can I do this with a while loop etc.?
    I thank you in advance for any help,
    Regards,
    Gary.

    Here's an article from JavaWorld describing some of the pitfalls when using Runtime.exec() that might help you:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Calling a transaction code in between the program and use the output

    Hi frnds,
              i want to call a transaction code in between the program   and pass the input .After getting the output, use that output in the program

    Hi Navin,
                     Why don't you sit with ABAPer he can explain better.
    Regards,
    HAri.

  • Creating Customized Table and Modify Table Maintenance Screen

    Hi,
    I have already created customized table and generate the table maintenance screen, however i encountered 1 problem which is i cannot add new PAI and PBO module in the flow logic. Every time i wanna add new module, i will be getting error message saying that my user currently editing the screen. Any suggestion ?
    Thanks.
    Jon

    Hi <b>Jonathan</b>,
    Please close all the windows and relogin
    For making PAI and PBO modules, Please activate all the Table and its maintainence view.
    Now first make emptu file with <main filename>_PAI and <main filename>_PBO save and activate them.
    Now put the logic in them and then activate now call these in the main prog.. it should work...
    While activation all the sub program modules should be activated already... i suggest select all the prog and sub progs and activate them all at once...so the system automatically takes care of inner activations first...
    If u have some more quereies... please feel free to contact me...
    Regards,,
    <b>Abhishek</b>

  • How to automate the execution of several programs and use their output

    Dear java members,
    I am trying to figure out how to get data from a file, database, or program and use that information in another program. Can you help please?
    I have looked through several texts and while the information is there somewhere I have not found the specific capabilities or examples that explain how to do this.
    I want to learn how to do this with objects.
    The specific applications I am working with are the GIS (Geographic Information System) suite of ESRI products such as ArcInfo and ArcView.
    I am working with simulators for hydrologeology (ground water) and other geophysical phenomenae. Programs for decisions and assessment of probability such as found in geostatistical analyses packages. Drawing programs and data manipulation programs such as spreadsheets in windows and scripting languages found in most Unix packages.
    I want to be proprietary platform free! I want to be accessing apps and or data wherever they are and in whichever form they are in or best used.
    Web techniques and protocols are where I think most of my effort will be focused.
    One of the mediums (media) that I expect to use a lot is XML.
    If I can find a simplified (generalized) explanation how this is done and how the parts fit together through and or with objects. If I can find references to texts and examples I will be very appreciative and very much less confused.
    I am interested in using the Java programming language.
    Thank you
    ctavares1

    Hello Tavares,
    What you seek can be done, but before that you must know from where you want to take the data. In what form you will get the data in and where you want to use it and how.
    Your problem is what we call an architectural issue. If possible please write to me at [email protected]
    With the above information - I shall be able to help you to some extent.
    Ironluca

  • How to run different programs and use their output in other programs

    Dear java members,
    I am trying to figure out how to get data from a file, database, or program and use that information in another
    program. Can you help please?
    I have looked through several texts and while the information is there somewhere I have not found the specific
    capabilities or examples that explain how to do this.
    I want to learn how to do this with objects.
    The specific applications I am working with are the GIS (Geographic Information System) suite of ESRI products
    such as ArcInfo and ArcView.
    I am working with simulators for hydrologeology (ground water) and other geophysical phenomenae. Programs for
    decisions and assessment of probability such as found in geostatistical analyses packages. Drawing programs
    and data manipulation programs such as spreadsheets in windows and scripting languages found in most Unix
    packages.
    I want to be proprietary platform free! I want to be accessing apps and or data wherever they are and in
    whichever form they are in or best used.
    Web techniques and protocols are where I think most of my effort will be focused.
    One of the mediums (media) that I expect to use a lot is XML.
    If I can find a simplified (generalized) explanation how this is done and how the parts fit together through and or
    with objects. If I can find references to texts and examples I will be very appreciative and very much less
    confused.
    I am interested in using the Java programming language.
    Thank you
    ctavares1

    Hello ctavares1,
    I am not quite sure that I understand what you are trying to do. The programs that you mention: ArcInfo and ArcView, are they stand alone, native, platform dependent applications? Or are they written in Java? It sounds like there are stand alone, native, platform dependent applications, that write their output to either a file or a database.
    The other piece that is puzzling me is: Do you intend to write an Applet or a Java Application? This is important because Java places several restrictions on what an Applet can do.
    There is also the question of how the data is produced. Is it produced all at once in batch or is it produced a little at a time in real time?
    These and other questions will need to be answered before you can begin designing your application. There are many tutorials dealing with opening a file or database and manipulating that data from an Applet or a Java Application, but it is a different matter all together getting data from an application.
    Here are a few tutorials on File I/O and JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    http://java.sun.com/docs/books/tutorial/essential/io/index.html
    -Merwyn,
    Developer Technical Support,
    http://www.sun.com/developers/support.

  • Calling a stored procedures and using its output parameters in a report

    Hi,,
    I have a procedure defined in a package on the database. This procedure returns a number of output parameters. How do I call this procedure and use the output parameters in my report ?
    Thanks, Mark

    Depends on the level at which the procedure has to be called. If its at report-level, call the Form in the BEFORE-REPORT-trigger (or AFTER-PARAMFORM) and store the out-values in Placeholder-columns. These you can use anywhere in your report.

  • Running programs and grabbing their output

    I'm kinda confused. I want to run command.com from java and be able to capture its output and print it somewhere else, as well as insert my own input through another medium (ie. JTextField). I know i can use runtime to execute it, and then use process to get the output stream and input stream, but when i get the output stream, it returns it as an output stream, which would mean i couldnt actually read what the program was outputting, i could only write to it, which doesnt make sense at all. Will somebody please explain to me what i'm doing wrong, or if i dont have it wrong, please explain to me how to do what i want to do.
    Thank you

    The above posts seem to be right:
    // Get the runtime. Replace 'this' with what you want from
    Runtime rt = this.getRuntime();
    // Intialize a variable for recieving the output
    byte b[] = new byte[10000];
    // Get a stream to recieve the output
    InputStream outputOfRT = rt.getRuntime();
    // Read the output. Use a better read() logic to all the stuff
    read(b);
    // Manipulate the b for what you want
    rajesh

  • How do I transfer over my Pages program and all its files to my new mac?

    I recently bought a macbook air and would like to continue to use my Pages program that I have been using on my old Macbook pro. Does anyone know if I can redownload it from the Apple store without having to pay or if there is another way I can access the program and all my old files?
    Thanks!

    The Apple Store is not the same as the Mac App Store, which is what I think KarenSelena is referring to when she says "Apps store." So, the question is, did you buy a retail box or a license for a downloaded trial of iWork '09 or did you buy the individual apps from the Mac App Store?
    If you did buy Pages from the Mac App Store you can go to the "purchases" section of the App Store.app & download it again using the same Apple ID as before.

Maybe you are looking for

  • Dynamic File naming in reciever File Adapter

    Hi all, I am using a reciever File adapter and my requirement is to generate 3 different file names based on the value of an element from the Payload.For example.. Say in Payload for the first Occurence of the Data segment which contains Field-1 and

  • I have a problem, i bought lion but when i want to install he said me i need to "download osx lion server" i'm running with the last lion beta. how to update please?

    i have a problem, i bought lion but when i want to install he said me i need to "download osx lion server" i'm running with the last lion beta. how to update please? ps: sorry for my english :S

  • Running JSP on netBeans 4.1

    Hi, I have just migrated from netBeans 4.0 to netBeans 4.1 beta, and was having problem compiling one of my JSP files (which ran perfectly on the older version of netbeans). I was wondering whether there is any setting I've missed. Appreciate some he

  • 5 SATA Drives on a MSI 7125 MB in Non-RAID

    Hello Everyone, I have been running 4 SATA drives, 3-250 GB Seagates and a Plextor DVD,  on my MB for awhile now.  I went to install Vista this weekend and added another drive so that I can functioning with XP until Vista is ready to use.  My questio

  • Problem in BAPI for FB70

    Hi all, I have used the BAPI_ACC_DOCUMENT_POST to create the customer invoice.But, when i run the program it is giving the error as    Error in document: BKPF $ DEVCLNT250    Incorrect entry in field OBJ_TYPE: BKPF i am passing the entry as OBJ_TYPE