Prabhu DC’s DataWarehouse

2^n bits {n->∞}

Sap Datastage – Unable to delete variant problem

It has been a while now since I have created a post. I have slowly migrated SAP’s  BI product and have been learning it. Recently we hit a major issue with datastage working with SAP.  I had to perform extensive simulation/analysis to understand the problem and come to a solution. I would like to share the analysis with everyone (could save some precious time). . .

Explanation

Multiple calls are made by datastage to the function module Z_RFC_DS_SERVICE with different parameters. Accordingly different activities such as create variant, delete variant, load program etc. is done.

Z_RFC_DS_SERVICE is the function module invoked remotely by datastage through the RFC.

Z_RFC_DS_SERVICE invokes the function module RS_VARIANT_DELETE

This function in turn invokes the form check_v_used_in_job.

perform check_v_used_in_job using rsvar-report rsvar-variant.

This function invokes the function module BP_VARIANT_USED_IN_JOB

Depending on the response from this function module the “unable to rename/delete variant” error is thrown. If the number of jobs in TBTCP is not equal to the number of entries in TBTCO which has finished or aborted status, the error will be thrown.


Consider the below screen-shot. These programs have been scheduled but not executed yet.

Let us consider BI_PROCESS_TRIGGER as an example. This program executes with the report name RSPROCESS and Variant name &0000000000076.

Below is the entry in TBTCP table

Below is the entry in TBTCO table

Below is the part of the program BP_VARIANT_USED_IN_JOB that calculates the value for l_no_jobs and l_finish_cancel.

The status field for these scheduled programs are blank in TBTCO. Hence the l_no_jobs=1 and l_finish_cancel=0 resulting in the error being thrown.

Simulation of variant deletion through SE38

Simulation of variant deletion through the program by which datastage is deleting.

Simulation of values thrown by the function module BP_VARIANT_USED_IN_JOB.

Deletion of job schedule in SM37 and validation of table entries

Entry has been deleted from TBTCP

Also from TBTCO

In a typical scenario following are the sequence of events when Datastage tries to create a variant in ECC and hence execute and ABAP program.

  1. Check RFC connection
  2. Create variant through Z_RFC_DS_SERVICE
  3. Trigger the job through the BAPI_XBP_JOB_START_IMMEDIATELY
  4. Check the status of the job in constant intervals
  5. Delete all job related information through BAPI_XBP_JOB_DELETE
  6. Finally delete the variant

Solution

In Datastage’s abort scenario or starting point, add a clean-up job. This job can do the following

  • Execute the FM BAPI_XBP_JOB_DELETE with the respective ABAP program name and variant name
  • Execute the FM Z_RFC_DS_SERVICE with parameter 10 to delete the variant
Advertisement

December 19, 2010 - Posted by | SAP BI | , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.