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

problem in form -endform

Former Member
0 Likes
760

if i write the below code in PBO module (status 1000) then it sets the output only field (PROCSS) to CREATE if t-code is 'ZPURCR_22609'

************************************

DATA PROCESS TYPE STRING.

IF SY-TCODE EQ 'ZPURCR_22609'.

PROCESS = 'CREATE'.

ENDIF.

IF SY-TCODE EQ 'ZPURCHG_22609'.

PROCESS = 'CHANGE'.

ENDIF.

IF SY-TCODE EQ 'ZPURDIS_22609'.

PROCESS = 'DISPLAY'.

ENDIF.

*****************************************

but instead if i write the code as shown below it doesn't set the output only field (PROCSS) to CREATE if t-code is 'ZPURCR_22609'

perform SET_NAME_OF_SCREEN_PBO.

in pbo and then i write the code in include file

FORM SET_NAME_OF_SCREEN_PBO.

DATA PROCESS TYPE STRING.

IF SY-TCODE EQ 'ZPURCR_22609'.

PROCESS = 'CREATE'.

ENDIF.

IF SY-TCODE EQ 'ZPURCHG_22609'.

PROCESS = 'CHANGE'.

ENDIF.

IF SY-TCODE EQ 'ZPURDIS_22609'.

PROCESS = 'DISPLAY'.

ENDIF.

ENDFORM.

if i write the below code in PBO module (status 1000) then it sets the output only field (PROCSS) to CREATE if t-code is 'ZPURCR_22609'

************************************

DATA PROCESS TYPE STRING.

IF SY-TCODE EQ 'ZPURCR_22609'.

PROCESS = 'CREATE'.

ENDIF.

IF SY-TCODE EQ 'ZPURCHG_22609'.

PROCESS = 'CHANGE'.

ENDIF.

IF SY-TCODE EQ 'ZPURDIS_22609'.

PROCESS = 'DISPLAY'.

ENDIF.

*****************************************

but instead if i write the code as shown below it doesn't set the output only field (PROCSS) to CREATE if t-code is 'ZPURCR_22609'

perform SET_NAME_OF_SCREEN_PBO.

in pbo and then i write the code in include file

FORM SET_NAME_OF_SCREEN_PBO.

DATA PROCESS TYPE STRING.

IF SY-TCODE EQ 'ZPURCR_22609'.

PROCESS = 'CREATE'.

ENDIF.

IF SY-TCODE EQ 'ZPURCHG_22609'.

PROCESS = 'CHANGE'.

ENDIF.

IF SY-TCODE EQ 'ZPURDIS_22609'.

PROCESS = 'DISPLAY'.

ENDIF.

ENDFORM.

5 REPLIES 5
Read only

Former Member
0 Likes
726

In PBO...u r not supposed to create a for...u shud do ur coding inside MODULE.

u can create a new module and do the same coding inside dat.

PBO.

MODULE STATUS_1000.

MODULE SET_PROCESS. "inside this put ur code.

Read only

Former Member
0 Likes
726

Hi,

In PBO write like this.


Module SET_NAME_OF_SCREEN_PBO.

THEN INSIDE THE MODULE WRITE


Module SET_NAME_OF_SCREEN_PBO OUTPUT.
DATA PROCESS TYPE STRING.

IF SY-TCODE EQ 'ZPURCR_22609'.
PROCESS = 'CREATE'.
ENDIF.

IF SY-TCODE EQ 'ZPURCHG_22609'.
PROCESS = 'CHANGE'.
ENDIF.

IF SY-TCODE EQ 'ZPURDIS_22609'.
PROCESS = 'DISPLAY'.
ENDIF.

ENDMODULE.

Regards

Sandipan

Read only

Former Member
0 Likes
726

hello,

what you are doing is right ,just declare the variable process outside the form ,in the abap editor and perform the subroutine like :

perform <subroutine> changing process.

form <subroutine changing process.

then this will store the changed value in the variable process.

hope it helps

geeta gupta

Read only

0 Likes
726

thanks your suggestion is correct but can you tell me what is the reason for this why we need to declare the variable outside perform and in pbo

Read only

Former Member
0 Likes
726

thanks geeta ur answer is helpful and correct