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

adding a import parameter to BADI

Former Member
0 Likes
1,223

Hi ,

I have a standard program HINCEPF1 for HR which generates two forms :

1)Form 3A

2)Form 6A

A BADI has been created by someone to upload the files in this standard program to insert data for the MARCH month in these above forms either one you select in the selection screen.The function module to upload the file which has been used is :

call function 'WS_FILENAME_GET'

**      call function 'WS_UPLOAD'

this function modules works fine when you select form 6A on selection screen but in case of Form 3A it works but does not uploads all the data .It only takes first 7 fields .So to upload data when we select Form 3A I have changed the BADI and added the function module :

KD_GET_FILENAME_ON_F4 and
ALSM_EXCEL_TO_INTERNAL_TABLE

to upload the file which works fine but this does not work with Form 6A.

So i want to put a CASE in the BADI that when we select Form 6A then the 1st function module should work and when Form 3A is selected then the above function module should work .

But when i try to add a importing parameter to BADI it does not let me do that . It gives a message that :

'Parameters/exceptions of inherited methods or events cannot be changed'.

Can anyone help.

5 REPLIES 5
Read only

Former Member
0 Likes
865

Hi,

Are you using BADI HR_IN_PF_REP_MARCH.As it is standard you cannot insert one more import parameter.

It is filer depended on Country..

If it is possible to find form type using country you can use filter depended implementation

If you cannot make it out than you need to read the global variable.

REPONAME

Which contain the form type in the badi.you can use field symbol to read that global data..

Read only

0 Likes
865

Hi Raj,

Thanks for your solution .

Yes i want to import Reponame from global data .

can u tell me how can i do that . I mean where and how to put the import parameter as i am new to this.

can u send me the code or something regarding this.

Read only

0 Likes
865

Hi,

Put the below code in ur badi implementation....

Note : Here i am reading RMQEA table's status text variable..

In ur case it will be form type which global in ur Report program HINCEPF1

DATA : V_VAL TYPE STRING VALUE '(SAPLQPL1)RMQEA-STATUSTEXT'. 
FIELD-SYMBOLS : <V_STS> TYPE RMQEA-STATUSTEXT.



ASSIGN (V_VAL) TO <V_STS>.
    IF <V_STS> IS ASSIGNED.
      MOVE <V_STS> TO V_SYSSTAT.
ENDIF.

For ur case it will be look like..

DATA : V_VAL TYPE STRING VALUE '(HINCEPF1)REPONAME'. 
FIELD-SYMBOLS : <V_STS> TYPE PIN_REPNM.   "Change the type if does not workk

ASSIGN (V_VAL) TO <V_STS>.
    IF <V_STS> IS ASSIGNED.
      MOVE <V_STS> TO V_SYSSTAT.
ENDIF.

check the value of V_SYSSTAT variable....i hope it will give u the correct form type..

NOTE : Fild symbol is very critical thing so take care...

Read only

0 Likes
865

Thanks Raj,

It works.

Read only

Former Member
0 Likes
865

I changed the type of the field symbol to type any and it works.

thanks RAJ.