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: 

SHDB for PA40 and selecting the right Action

Former Member
0 Kudos

I am attempting to create a BDC session for PA40 using SHDB and see that there is no "positioning function" to make sure that you select the right action type in PA40 can someone give some guideance here?

Thanks

Bill Hofford

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think this is possible. Check out the code below to see if it helps :

Get the Actions from T588B (mntyp = 'M, menue = '01') into an internal table.

Assume each Page has 11 actions or maybe you could do a page break after each action. So Actions 1-11 in the itab would have another column Page Break with value = 1, 12-22 would have Page Break with value = 2 etc

For each action that you are processing (say from the input file), find out the counter & how many pages to go down from the above itab.

  • Prepare Field Name for the Action

move counter to numc_counter.

concatenate 'RP50G-SELEC(' numc_counter ')'

into fieldname.

condense fieldname no-gaps.

do Page_Break times.

perform append_bdc_data using:

'X' 'SAPMP50A' '2000',

' ' 'RP50G-PERNR' t_input-pernr,

' ' 'BDC_OKCODE' '=P+'.

enddo.

  • PICK action

perform append_bdc_data using:

'X' 'SAPMP50A' '2000',

' ' 'RP50G-PERNR' t_input-pernr,

' ' 'RP50G-EINDA' t_input-effdat,

' ' fieldname 'X',

' ' 'BDC_OKCODE' '=PICK'.

9 REPLIES 9

Former Member
0 Kudos

Hi William,

Check the field RP50G-SELEC(<b>02</b>).Here no 2 is

the number of action type ex: for Hiring it is 01.

For org Assignment it is 02. Like that you need to pass.

If you are hiring employee then

RP50G-SELEC(<b>01</b>) = 'X'.

If you are Org Reassiging employee then

RP50G-SELEC(<b>02</b>) = 'X'.

Like that you need to check the no.

Hope this will help you.

Thanks & Regards,

Siri.

Kindly award points if it is useful.

Message was edited by: Srilatha T

Message was edited by: Srilatha T

0 Kudos

Guess I need to rephrase my question I did the recording in SHDB and my desired action type did not show up in the initial screen so I had to page down and select action Reorg (Org unit/Position) which is action K1. For me this was RP50G-SELEC(05) on the second page of action types. how can I always guarantee that I am getting the right action type RP50G-SELEC(05) might be right today but tomorrow ???

0 Kudos

Hi William,

Yeah thre is a chance of getting chnged if some changes happen to the program.

But I guess this number is not stored any where.

Just we have to hardcode it. I am not sure , in my program I am doing like that only.

Siri.

Message was edited by: Srilatha T

0 Kudos

HI William,

There may be any table where the Action types being displayed , will be stored sequentially. The sequence number of which may be the index of the action type.

I never worked with HR programming, but i had a similar requirement in SD, where I found a table for the position number which also was the index for the line.

Regards,

Ravi

Former Member
0 Kudos

Hi William,

The best solution for creation of records in infotypes, is through FM HR_INFOTYPE_OPERATION.

The corresponding data should be populated and submitted in <b>record</b>, with other details like <b>Infotype, pernr, Subtype,Validity End, Validity Begin, Operation.</b>

Please refer the FM documentation.

Hope this helps...

For a sample...

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0045'

number = pernr

subtype = subty

record = p0045

operation = create

nocommit = nocommit

IMPORTING

return = return

key = bapikey

EXCEPTIONS

OTHERS = 0.

Regards,

Rajasekhar

Message was edited by: Rajasekhar Dinavahi

Former Member
0 Kudos

Hi William,

Instead of hard coding the line, try this:

Select 'MASSN' and 'MNTXT' from 'T529T' table. Now that u have the action type and the text, search for the action type in the internal table holding the above values with the action text you wish to have. Concatenate 'RP50G-SELEC' and the value of MASSN and pass it to BDCTAB.

By this you do not have to worry about change in position of the action. This change of position happens because of the sorting of the action types in the Database Table.

Naveen.

0 Kudos

Hi,

I would go with HR_INFOTYPE_OPERETION instaed of a BDCas this would accept the infotype structure as the parameter. That way we need not worry about screen mods via T588M & future screen changes SAP

Regards,

Suresh Datti

0 Kudos

I tried concatenating RP50G-SELEC and MASSN but the screen does not recognize this it is expecting a loop index RP50G-SELEC(nn) where nn is a number.

For everyone suggesting that I use the Function Module HR_INFOTYPE_OPERATION I don't think this is a viable option either since PA40 updates multiple infotypes and I don't want to call this for each infotype involved.

Former Member
0 Kudos

I think this is possible. Check out the code below to see if it helps :

Get the Actions from T588B (mntyp = 'M, menue = '01') into an internal table.

Assume each Page has 11 actions or maybe you could do a page break after each action. So Actions 1-11 in the itab would have another column Page Break with value = 1, 12-22 would have Page Break with value = 2 etc

For each action that you are processing (say from the input file), find out the counter & how many pages to go down from the above itab.

  • Prepare Field Name for the Action

move counter to numc_counter.

concatenate 'RP50G-SELEC(' numc_counter ')'

into fieldname.

condense fieldname no-gaps.

do Page_Break times.

perform append_bdc_data using:

'X' 'SAPMP50A' '2000',

' ' 'RP50G-PERNR' t_input-pernr,

' ' 'BDC_OKCODE' '=P+'.

enddo.

  • PICK action

perform append_bdc_data using:

'X' 'SAPMP50A' '2000',

' ' 'RP50G-PERNR' t_input-pernr,

' ' 'RP50G-EINDA' t_input-effdat,

' ' fieldname 'X',

' ' 'BDC_OKCODE' '=PICK'.