Application Development and Automation 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: 
Read only

Selection screen

Former Member
0 Likes
1,224

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,165

Hi Tarang,

I added one statement to ur program.Now it is working fine.Let me know if u have further queries.OK.

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.

<b>SET PF-STATUS SPACE.</b>

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.

<b>

Reward all helpful answers</b>

Regards,

V.Raghavender.

12 REPLIES 12
Read only

amit_khare
Active Contributor
0 Likes
1,165

instead of At SELECTION SCREEN use START-OF-SELECTION.

Regards,

Amit

Reward all helpful replies.

Read only

0 Likes
1,165

Dear Khare ,

i have to use at selection screen as i want to perform the bdc

on press of enter also on the selection screen

Read only

0 Likes
1,165

Hi

BDC performing should be in Start of selection event.

change the code like this and see

PARAMETERS : KANID TYPE PKPS-PKKEY.

AT SELECTION-SCREEN.

CTUMODE = 'N'.

CUPDATE = 'S'.

AT SELECTION-SCREEN OUTPUT.

KANID = ''.

<b>START-OF-SELECTION.</b>

PERFORM BDC_DYNPRO USING 'SAPLMPKP' '0301'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RMPKB-PKKEY'.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
1,165

Hi,

You need use the START-OF-SELECTION, then it will back to the selection screen. you are doing all the code in AT SELECTION-SCREEN, so it won't display the Selection screen when you press Back button,

Regards

Sudheer

Read only

Former Member
0 Likes
1,165

Hello,

Insted of using leave to list-processing, use LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN "ur screen number"

Regards

Read only

Former Member
0 Likes
1,165

Dear all,

i understand all your replies

but as i told i need to perform the bdc when somethin is entered in feild KANID

and then ENTER is pressed and NOT F8 ... so i have to write the bdc in at selection-screen

Read only

Former Member
0 Likes
1,166

Hi Tarang,

I added one statement to ur program.Now it is working fine.Let me know if u have further queries.OK.

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.

<b>SET PF-STATUS SPACE.</b>

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.

<b>

Reward all helpful answers</b>

Regards,

V.Raghavender.

Read only

Former Member
0 Likes
1,165

Hi,

After the CALL TRANSACTION STATMENT, you are doing the Process to report for the messages, put the code in START-OF-SELECTION

Regards

Sudheer

Read only

Former Member
0 Likes
1,165

Thanx.... Raghvender this solved my problem but

can u pls explain that statment set pf-status space.

Read only

Former Member
0 Likes
1,165

HI Tarang,

Can u please send me the code of u r Object.

Hakeem.

Read only

Former Member
0 Likes
1,165

Hi Tarang,

i developed one kanban card by using SAPSCRIPT.Its is working fine.

And next i need to develop one program for the status sequence.

The Barcode is scanned via a scanner ( or ) status changed by manually , the status will update into tables throgh transactions.

Pleasee help on this.

Hakeem