, , ,

This is for an SAP setup, from which a data file needed to upload to a remote machine , and yes dont jump, there is no XI / PI in the landscape and that is why this is such an interesting story.

The SAP landscape has a very generic setup like, a CI/DB cluster environment with some more application servers. The user load was managed using logon groups.  The initial requirement came as very minimal normal approach from the functional consultants, as we need to upload some data file to a remote ftp server. 

So the request went to coders, SAP abap for writing an ABAP report and shell scripter to write a ftp script. And the ABAPER used the well-known SXPG_COMMAND_EXECUTE for calling the ftp script. So far thing were OK and it is working fine. Later the requirement came to run the entire thing in a schedule job to reduce the human interrupt on a routine job….Here started the joke….

So at the first level we created a directory on our shared storage device and configured it such that the directory is mounted by the same name (mounting point) from all the application serversincluding both node of the CI/DB cluster. Permission for this mount point was taken care in such a way so that sap<sid> (user)and sapsys (group) has full permissions on this. We did so, with a thought in mind that this background job can land up any of the available application servers according to availability of the resources.

Surprisingly we noticed that this background job fails in one of the particular application server, and initially it was cancelled with error message Job aborted….And it was happening before the ftp script is called.

ABAP team was asked about inserting some more error messaging facilities using SY_MSGV1, SY_MSGV2, SY_MSGV3……We used information from the online help of SAP.

Finally we were able to get the detailed error message…
Which is as follows …

Object Zxxx..of class RE and language EN does not exist.
Job cancelled with return code as 1.

As usual from the Basis side the same thing is forwarded to ABAP team and nothing happened, and we all were guessing like the things might be happening due to some issue related to OS, file sharing and licenses…

Finally we understood, that there is an authorization object S_LOG_COM is responsible for this. Here you are supposed to provide the server name, the program name the OS name and finally the things went right.

But here is an important things I noticed…

Initially in the host of S_LOG_COM, we found that the CI (central Instance) server name is not there, so we added the server name. But it didn’t work untill we put * in all that is Host, Command and Operating system. This is still a mistry and I am yet to find out the reason….

The piece of code we are using is something like below….

<Start Code>

  if sy-subrc ne 0.
         message id sy-msgid
         type sy-msgty
         number sy-msgno
        with sy-msgv1
        message a002(zgen) with
        ‘Job cancelled with return code as’ gv_subrc.

gv_cmd = ‘Z_BCP_EXE’.
gv_target = sy-host.
gv_os = sy-opsys.
call function ‘SXPG_COMMAND_EXECUTE’
           commandname = gv_cmd
           operatingsystem = gv_os
           targetsystem = gv_target
           additional_parameters = gv_filename
            exec_protocol = gt_test
            no_permission = 1
            command_not_found = 2
            parameters_too_long = 3
            security_risk = 4
            wrong_check_call_interface = 5
            program_start_error = 6
            program_termination_error = 7
            x_error = 8
            parameter_expected = 9
            too_many_parameters = 10
            illegal_command = 11
            wrong_asynchronous_parameters = 12
            cant_enq_tbtco_entry = 13
            jobcount_generation_error = 14
            others = 15.

gv_subrc = sy-subrc.

 <End Code> 

 I have colored to make it prominent…

Dont know where is the answer….

Miles to go before I sleep…