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 obtain PERNR during BDC with PA40

Former Member
0 Kudos

Greetings!

I recorded a PA40 session and am using the code in my program with success. However, now I must make a call during the BDC code to a FM which requires the PERNR. I'm not sure how to obtain the PERNR while the BDC code is executing. I'm sure if I was doing it manually via PA40 I would be able to "see" the PERNR on the screens but I'm not sure how to obtain it while the BDC code is running.

Thanks in advance.

Snippet of code:


    ...
    PERFORM bdc_dynpro      USING 'MP000200'                '2010'.
    PERFORM bdc_field       USING 'BDC_CURSOR'              'Q0002-FATXT'.
    PERFORM bdc_field       USING 'BDC_OKCODE'              '=UPD'.
    PERFORM bdc_field       USING 'P0002-BEGDA'             lv_begda.
    PERFORM bdc_field       USING 'P0002-ENDDA'             '12319999'.
    PERFORM bdc_field       USING 'P0002-NACHN'             gt_enrollment-lname.
    PERFORM bdc_field       USING 'P0002-VORNA'             gt_enrollment-fname.
    PERFORM bdc_field       USING 'P0002-MIDNM'             gt_enrollment-mname.
    PERFORM bdc_field       USING 'Q0002-PERID'             gt_enrollment-ph_ssn.
    PERFORM bdc_field       USING 'P0002-GBDAT'             gt_enrollment-dob.
   ...
   

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Steve - once you hand control over to the BDC, you cannot do anything until control comes back to your program.

Rob

3 REPLIES 3

Former Member
0 Kudos

Steve - once you hand control over to the BDC, you cannot do anything until control comes back to your program.

Rob

0 Kudos

Rob:

Thanks for the reply.

The following two lines are the ones that my functional guy is telling me I need to change from hard-coded values to those from HR_BEN_GET_FROM_FEATURE_XXXX; however, this FM requires the PERNR. It looks like the only option I have is to wait until the BDC is finished and then do a "MOD" operation via HR_INFOTYPE_OPERATION. Suggestions?


    PERFORM bdc_field     USING 'P0171-BENGR'            '0002'.
    PERFORM bdc_field     USING 'P0171-BSTAT'            '0002'.

0 Kudos

Well, what is the BDC doing - creating an HR master record? If so, I guess you could wait for it to finish, then call your FM and then change the record you just created.

Or it would be better if you could just figure out what the FM would bring back and then use thoise values when creating the record.

Rob