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: 

PA40 while Hiring Business area should be default in infotype '0001'

Former Member
0 Kudos
156

HI,

while hiring in pa40. infotype 0001

if company code is 7000. i need gsber to be default 'TTT1'. so i worte this coding. but it is not working.

if sy-tcode = 'PA40'.

IF INNNN-INFTY EQ '0001'.

DATA: wa_P0001 like P0001.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = wa_P0001.

After this coding if i keep debug wa_p0001 is not filling. it is empty.

CASE wa_P0001-BUKRS .

WHEN '7000'.

wa_P0001-GSBER = 'TTT1'.

*WHEN '0002'.

*wa_P0001-GSBER = 'B002'.

ENDCASE.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = wa_P0001

IMPORTING

PRELP = INNNN.

endif.

endif.

can any one give better option for this.

Thank you

Rajesh.

1 REPLY 1

Former Member
0 Kudos
67

Hi,

I think you are writing this code in 'ZXPADU01' , which is PBO event.

By this time company code data is not entered on 0001 screen for hiring.

Below WA_P0001 is not filled ..

if sy-tcode = 'PA40'.

IF INNNN-INFTY EQ '0001'.

DATA: wa_P0001 like P0001.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = wa_P0001.

.

.

.

try writing the code in PAI event .( Include ZXPADU02)

Regards,

Srini.