Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a report in bapi

Former Member
0 Kudos

Hi..

i have copied and modified standard bapi bapi_quotation_createfromdata.

Ihave got a program in se38 as yragtest4..

i need to call this report in my bapi and should be able to run from bapi..

Raghu

7 REPLIES 7

Former Member
0 Kudos

look the help for command "submit report".

Former Member
0 Kudos

Hi,

Goto swo1. Enter object Type->Method->Select particular Method and go to the programme of that method. There u try to use SUBMIT <Programme name>.

It should work the way you want.

If helpful plz reward.

Cheers

Former Member
0 Kudos

Thanks for your quick replies laurel and das.

das i tryed ur method..but i am not sure which method to take..

is there any other function modules method or like that..

regards.

vijay

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try FM <b>SUBMIT_REPORT</b>.

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

Thanks for your reply ferry..

what do i need to do here..

plz suggest me.

CALL FUNCTION 'SUBMIT_REPORT'

EXPORTING

  • RDIR = TRDIR

report = 'zragtest4'

  • RET_VIA_LEAVE = 'X'

  • VARIANT = ' '

  • VARIPROG = ' '

  • SKIP_SELSCREEN = ' '

  • EXPRESSIONS =

  • IMPORTING

  • VARIANT =

  • TABLES

  • SELECTION_TABLE =

  • EXCEPTIONS

  • JUST_VIA_VARIANT = 1

  • NO_SUBMIT_AUTH = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Former Member
0 Kudos

deleted- double post sorry

Message was edited by: Laurent Robin

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can code something like this inside the BAPI.

...

TABLES: TRDIR.

SELECT SINGLE * FROM TRDIR WHERE NAME = 'ZRAGTEST4.

CALL FUNCTION 'SUBMIT_REPORT'
  EXPORTING 
    REPORT        = TRDIR-NAME
    RDIR          = TRDIR           
    RET_VIA_LEAVE = ' '.

IF SY-SUBRC = 0.
  ...
ELSE.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. 

...

Regards,

Ferry Lianto

Please reward points if helpful.