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: 

Error using HR_MAINTAIN_MASTERDATA when run program via background

Former Member
0 Kudos

Hi gurus,

I've developed an upload program which reads the data from interface file and perform hiring for new employee. When i execute the program via foreground there is no error and the employee is hired successfully. However, when i set the program to execute via background, it will throw error "Fill in all required field".

The below is the FM that i've inserted and it worked fine during foreground. Any ideas why in background it will throw such errors? Anyway i can debugged it?

Thanks and regards,

Loo

4 REPLIES 4

Former Member
0 Kudos

From the fact that this FM has a parameter dialog and the description of the error I'm guessing it carries out a GUI mediated file upload. When a program is run in background the server process isn't connected to any fronted application server so GUI mediated uploads are not possible.

To read a file in background you would have to upload to the application server and read it from there.

If this isn't the problem then please provide the dump description,

former_member217316
Contributor
0 Kudos

Hi Loo

Just a suggestion. Won't it be better if you use BAPI_HRMASTER_SAVE_REPL_MULT.

Give it a try.

Thanks,

Harsh

Former Member
0 Kudos

Hi Loo,

FM HR_MAINTAIN_MASTERDATA is not released for customer use by SAP(Check this SAP Note 1913529)

Use the FM HR_PAD_HIRE_EMPLOYEE instead.


Regards,

Ashvin

former_member226225
Contributor
0 Kudos

Hi Loo,

In the dialog_mode parameter what your are passing for background ?

check the dialog_mode Parameter.

for foreground it is '1' and for background it is '0'.

Please find the below documentation for dialog_mode parameter,

Description

You specify here whether the action is to be processed in the background in general, whether the action is to be processed in the background until an error occurs, or whether the change is to be made in a dialog box.

Value range

You can submit one of three values: ‘0’, ‘1’, or ‘2’, which mean the following:

  • '0' – The change is processed principally in the background. If an error occurs (in other words, an E message or A message), the entire action is canceled and the module returns a corresponding error message in the 'RETURN' structure.
  • '1' – The change is processed in the background. If an error occurs, the system switches to a dialog box so that the user can correct the entries.
  • '2' – The change is processed in a dialog box.

Default

The default value is ‘0’, meaning that the process runs in the background.

I hope this will be helpful.

Thanks & Regards,

Raghunadh Kodali.