Skip to Content
0
Former Member
May 07, 2007 at 07:05 AM

Selection screen

33 Views

Dear all ,

i have written a bdc program which has a selection screen

REPORT ZBAR_CODE

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

  • messages of call transaction

DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

  • error session opened (' ' or 'X').

DATA : CTUMODE LIKE CTU_PARAMS-DISMODE,

"A: show all dynpros

"E: show dynpro on error only

"N: do not display dynpro

CUPDATE LIKE CTU_PARAMS-UPDMODE.

"S: synchronously

"A: asynchronously

"L: local

DATA : SIGN .

DATA : PID.

DATA: MESSAGE(100).

PARAMETERS : KANID TYPE PKPS-PKKEY.

AT SELECTION-SCREEN OUTPUT.

KANID = ''.

AT SELECTION-SCREEN.

CTUMODE = 'N'.

CUPDATE = 'S'.

.

PERFORM BDC_DYNPRO USING 'SAPLMPKP' '0301'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RMPKB-PKKEY'.

PERFORM BDC_FIELD USING 'RMPKB-PKKEY'

KANID.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SAVE'.

PERFORM BDC_FIELD USING 'RMPKB-FSTFG'

''.

PERFORM BDC_FIELD USING 'RMPKB-PKINR'

'X'.

PERFORM BDC_FIELD USING 'RMPKB-FLEER'

'X'.

PERFORM BDC_FIELD USING 'RMPKB-PKMWP'

''.

CALL TRANSACTION 'PK21' USING BDCDATA

MODE CTUMODE

UPDATE CUPDATE

MESSAGES INTO MESSTAB.

leave to list-processing.

IF MESSTAB[] IS INITIAL.

WRITE : / 'Kanban Status Successfully changed from full to empty'.

ELSE.

LOOP AT MESSTAB.

IF MESSTAB-MSGTYP = 'S'.

WRITE : / 'Kanban Status Successfully changed from full to empty'.

ELSEIF MESSTAB-MSGTYP <> 'S'.

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

MSGID = MESSTAB-MSGID

  • msgtyp = messtab-msgtyp

MSGNR = MESSTAB-MSGNR

MSGV1 = MESSTAB-MSGV1

MSGV2 = MESSTAB-MSGV2

MSGV3 = MESSTAB-MSGV3

MSGV4 = MESSTAB-MSGV4

IMPORTING

MESSAGE_TEXT_OUTPUT = MESSAGE

EXCEPTIONS

OTHERS = 1.

.

WRITE : / MESSAGE .

ENDIF.

ENDLOOP.

ENDIF.

KANID = ''.

REFRESH BDCDATA[].

CLEAR BDCDATA.

now this report has parameters KANID.

when somethin is entered in kanid and u press enter

control goes to at selection screen .. bdc is performed

and error log is displayed

here it displays the error logs poperly but when u press back on the screen on which error is displayed it desnt go to the

selection screen.

i have tried using end-of-selection also but it is not workin.

kindly help.