Skip to Content
avatar image
Former Member

Put two Z programs and SM35 logic under one transaction

Hi friends,

Now, I am using this scenario step by step:

1. step: Transaction ZUPLOAD for uploading file to application server. Code for this is:

data: begin of oldrec occurs 0,
        txt1(250),
        txt2(250),
      end of oldrec.

start-of-selection.

call function 'UPLOAD'
  tables data_tab = oldrec
  exceptions others = 1.

if sy-subrc ne 0.
  write:****
else.
  open dataset outfile for output in text mode.
  if sy-subrc = 0.
    loop at oldrec.
      transfer oldrec to outfile.
    endloop.
    close dataset outfile.
    if sy-subrc = 0.
      write:****
    else.
      write:****
    endif.
  else.
    write:*****
  endif.
endif.

2. step: TR SE38 run Z program for preparing file to serve as input for RFBIBL00. (I have source code)

3. step: go to TR SM35 and proces new created session.

Final result is posted FI document that I can view using FB03.

My question is: How can I make one program that will do these 3 steps? I want to have one transaction that will do all these 3 steps and as output that will give me posted document. if you need I may send you to private mail screen shots and all codes of what I do and my scenario and what I want to have now.

Thanks a lot.

Nihad

Edited by: nihad omerbegovic on Oct 17, 2008 4:15 PM

Edited by: nihad omerbegovic on Oct 17, 2008 4:25 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

23 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 17, 2008 at 02:31 PM

    Hi,

    You can do this in one program only.

    Write a program to create a file mentioned by you in STEP1.

    If the file is successfully created then use Submit statement in the program to call the report 'RFBIBL00' with the file name OUTFILE you created. (STEP 2).

    STEP 3 i think will be taken care by the std program you are using i.e., 'RFBIBL00', then check SM35.

    With Regards,

    Dwarakanath.S

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 02:36 PM

    Hi,

    I want to have only one program that will be under one transaction.

    When I run that Transaction all logic under STEP 1, STEP 2 and STEP 3 will be done so I would have posted document as final result.

    I can not run SM35 separately. Session must be procesed during performing of this unique Z program.

    I wait for your replies, Thanks

    Nihad

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      As a®s said, you have to submit RSBDCSUB as well, but this will process the batch input session in a separate process and will continue after the original program finishes.

      If I understand your requirements, I don't think there is a way to fulfil them.

      Rob

  • avatar image
    Former Member
    Oct 17, 2008 at 02:45 PM

    Rob, session may be processed in background, separately doesn't matter. I just want to have my document posted when I leave this new program.

    Thanks.

    Edited by: nihad omerbegovic on Oct 17, 2008 4:45 PM

    Edited by: nihad omerbegovic on Oct 17, 2008 4:46 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      The document will probably not be posted by the time you program finishes. RSBDCSUB justs submits the batch input session and returns. The BDC then just continues on it's own.

      Rob

  • Oct 21, 2008 at 07:04 AM

    The program should look like

    - CALL TRANSACTION ZUPLOAD

    - SUBMIT Zreport

    - SUBMIT RSBDCSUB (or CALL TRANSACTION SM35)

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 21, 2008 at 07:30 PM

    Ok, I closed the other thread.

    Have a look at my question guys, should I put select, loop at and write in main program.

    is there need to define my internal structures like it_bseg and it_bkpf and how

    could I take data since I have no any condition??

    after my program finishes for posted documents fieldsa like usnam, belnr, time and date should be taken

    from bseg and bkpf.

    I have no acess to system right now. any idea is welcomed

    thanks

    Nihad

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      You will not have access to these fields until after the batch input session finishes. That will probably not be until after this program finishes. That is what I said in my earlier post.

      Rob

  • avatar image
    Former Member
    Oct 21, 2008 at 07:40 PM

    Thanks,I understand Rob, but what should I do? I need these fields in output. How to overcome this problem?

    Nihad

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Using RFBIBL00 and RSBDCSUB, you cannot.

      You would have to re-write your current process using call transaction (not a simple process).

      Look at alternatives . After your program and the batch input session have completed, run a report that gives the information you need.

      However -

      If you set the "Data transfer type" to 'C' (call transaction) on the selection screen for RFBIBL00, you may be able to get the documents. (I haven't tried this.)

      And you won't have to submit RSBDCSUB.

      Rob

      Edited by: Rob Burbank on Oct 21, 2008 3:53 PM

  • avatar image
    Former Member
    Oct 17, 2008 at 02:31 PM

    Can you use SUBMIT?

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 02:31 PM

    Hello,

    I suggest you to use the SUBMIT or CALL TRANSACTION commands.

    See this for more help http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9d7535c111d1829f0000e829fbfe/frameset.htm

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 02:34 PM

    1. Create a program with step 1 then for step 2 use SUBMIT Zprogram and for step 3 use SUBMIT RSBDCSUB

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 02:42 PM

    Ok, thanks I will try and give you feedback. I don't have access to system until monday so I will send you reply. Thanks again.

    Nihad

    Add comment
    10|10000 characters needed characters exceeded