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: 

How to display the output screen when I use bdc.

Former Member
0 Kudos

hey expert,

I want to display the output screen when i use bdc without using mode 'A'.

thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can go for mode 'E'.. it will display the output screen directly and if there is any error in the transaction you would get that particular screen and you can correct and continue after which you will get the final screen if anything goes fine...

check this sample code....

I had a program if you execute below program it automatically creates a new zprogram.


REPORT  zprogram_create_recording.


PARAMETER:
  p_prog    TYPE sy-repid OBLIGATORY,
  p_shtxt TYPE repti OBLIGATORY,
  p_pack  TYPE devclass DEFAULT '$tmp'.

DATA:
  t_bdcdata LIKE
   STANDARD TABLE
         OF bdcdata.
DATA:
  wa_bdcdata LIKE LINE OF t_bdcdata.

REFRESH t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-program    =  'SAPLWBABAP'.
wa_bdcdata-dynpro     =  '0100'.
wa_bdcdata-dynbegin   =  'X'.
wa_bdcdata-fnam       =  'RS38M-PROGRAMM'.
wa_bdcdata-fval       =  p_prog.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'BDC_OKCODE'.
wa_bdcdata-fval       =  'NEW'.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-program    =  'SAPLSEDTATTR'.
wa_bdcdata-dynpro     =  '0200'.
wa_bdcdata-dynbegin   =  'X'.
wa_bdcdata-fnam       =  'RS38M-REPTI'.
wa_bdcdata-fval       =  p_shtxt.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'TRDIR-SUBC'.
wa_bdcdata-fval       =  '1'.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'BDC_OKCODE'.
wa_bdcdata-fval       =  'CONT'.
APPEND wa_bdcdata TO t_bdcdata.

IF p_pack EQ '$TMP'.
*local object
  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0100'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO007-L_DEVCLASS'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'TEMP'.
  APPEND wa_bdcdata TO t_bdcdata.


ELSE.
*package assignment with request
  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0100'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO007-L_DEVCLASS'.
  wa_bdcdata-fval       =  p_pack.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'ADD'.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0300'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO008-TRKORR'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'KO008-AS4TEXT'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'LOCK'.
  APPEND wa_bdcdata TO t_bdcdata.


ENDIF.                                 " IF P_PACK EQ '$TMP'

CALL TRANSACTION 'SE38' USING t_bdcdata MODE 'E'.

Hope this would help you..

Regards

Narin Nandivada

3 REPLIES 3

venkat_o
Active Contributor
0 Kudos

Hi Heum Kim, Its just simple. 1. If you use Session method, after CLOSE_GROUP function module, use WRITE statement to display data on output. 2.If u use CALL transaction, use WRITE statement after the CALL TRANSACTION statement. I hope that it helps u . Regards, Venkat.O

Former Member
0 Kudos

Hi,

You can go for mode 'E'.. it will display the output screen directly and if there is any error in the transaction you would get that particular screen and you can correct and continue after which you will get the final screen if anything goes fine...

check this sample code....

I had a program if you execute below program it automatically creates a new zprogram.


REPORT  zprogram_create_recording.


PARAMETER:
  p_prog    TYPE sy-repid OBLIGATORY,
  p_shtxt TYPE repti OBLIGATORY,
  p_pack  TYPE devclass DEFAULT '$tmp'.

DATA:
  t_bdcdata LIKE
   STANDARD TABLE
         OF bdcdata.
DATA:
  wa_bdcdata LIKE LINE OF t_bdcdata.

REFRESH t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-program    =  'SAPLWBABAP'.
wa_bdcdata-dynpro     =  '0100'.
wa_bdcdata-dynbegin   =  'X'.
wa_bdcdata-fnam       =  'RS38M-PROGRAMM'.
wa_bdcdata-fval       =  p_prog.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'BDC_OKCODE'.
wa_bdcdata-fval       =  'NEW'.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-program    =  'SAPLSEDTATTR'.
wa_bdcdata-dynpro     =  '0200'.
wa_bdcdata-dynbegin   =  'X'.
wa_bdcdata-fnam       =  'RS38M-REPTI'.
wa_bdcdata-fval       =  p_shtxt.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'TRDIR-SUBC'.
wa_bdcdata-fval       =  '1'.
APPEND wa_bdcdata TO t_bdcdata.

CLEAR wa_bdcdata.
wa_bdcdata-fnam       =  'BDC_OKCODE'.
wa_bdcdata-fval       =  'CONT'.
APPEND wa_bdcdata TO t_bdcdata.

IF p_pack EQ '$TMP'.
*local object
  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0100'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO007-L_DEVCLASS'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'TEMP'.
  APPEND wa_bdcdata TO t_bdcdata.


ELSE.
*package assignment with request
  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0100'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO007-L_DEVCLASS'.
  wa_bdcdata-fval       =  p_pack.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'ADD'.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-program    =  'SAPLSTRD'.
  wa_bdcdata-dynpro     =  '0300'.
  wa_bdcdata-dynbegin   =  'X'.
  wa_bdcdata-fnam       =  'KO008-TRKORR'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'KO008-AS4TEXT'.
  wa_bdcdata-fval       =  ' '.
  APPEND wa_bdcdata TO t_bdcdata.

  CLEAR wa_bdcdata.
  wa_bdcdata-fnam       =  'BDC_OKCODE'.
  wa_bdcdata-fval       =  'LOCK'.
  APPEND wa_bdcdata TO t_bdcdata.


ENDIF.                                 " IF P_PACK EQ '$TMP'

CALL TRANSACTION 'SE38' USING t_bdcdata MODE 'E'.

Hope this would help you..

Regards

Narin Nandivada

0 Kudos

Hi Narin Nandivada,

thank you for your reply.

i write it as you tell me.

but i don't want to go to the input screen when i click the go back button.

how to do it? and i am not allow to modify the program.

thanks.

kim heum