cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Tcode not getting populated with values when called from Workflow

Former Member
0 Kudos

Hello,

I have a custom program written that displays certain details for a PO. This program is assigned to a Z-transaction.

I have now extended by Business Object to include a method to call this transaction and the program looks like this:

BEGIN_METHOD COST_CHANGES CHANGING CONTAINER.

SET PARAMETER ID 'BES' FIELD OBJECT-KEY-PURCHASEORDER.

CALL TRANSACTION 'ZFINREL' AND SKIP FIRST SCREEN.

END_METHOD.

Whenever I execute this method from within a workflow, the workflow takes me directly to the transaction, but doesnt populate the Purchase order details in the transaction.

However, if I create a method with reference to a SAP standard Tcode, I do not have any issues.

Would appreciate assistance with what I am missing.

Thank you,

Satish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Satish,

Since it is a Custom program, you can directly submit the report and have you imported the value from workflow to custom method. You need to create PurchaseOrder as Import parameter.

Example Code

BEGIN_METHOD COST_CHANGES CHANGING CONTAINER.

DATA:  PURCHASEORDER TYPE EKKO-EBELN.

SWC_GET_ELEMENT CONTAINER 'PurchaseOrder' PURCHASEORDER.

SUBMIT ZFINREL_PROG USING SELECTION-SCREEN '1000'
         WITH  PurchaseOrder eq  EBELN
          AND RETURN.

* ZFINREL_PROG is your custom program 
*EBELN is parameter on custom program

END_METHOD.

Problem may with the binding from workflow to custom program or in process of Call transaction the parameter value may be missing. Try above code and it must work.

Thanks,

Sudhir.

Former Member
0 Kudos

Hi Sudhir,

Thank you for your response. I followed your advice and changed my code as below. I have called the custom program related to the Tcode ZFINREL which is ZFI_PO_RELEASE_REPORT and the parameter s_ebeln is being used to capture the PO details in the custom program. The PO values are being passed from the main workflow to the step and to the task and the bindings are OK.

The error message I get now is "Field "S_EBELN" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement".

Any suggestions on how to fix this ?

          • Implementation of object type Z_BUS2012 *****

INCLUDE <OBJECT>.

BEGIN_DATA OBJECT. " Do not change.. DATA is generated

  • only private members may be inserted into structure private

DATA:

" begin of private,

" to declare private attributes remove comments and

" insert private attributes here ...

" end of private,

BEGIN OF KEY,

PURCHASEORDER LIKE EKKO-EBELN,

END OF KEY.

END_DATA OBJECT. " Do not change.. DATA is generated

BEGIN_METHOD COST_CHANGES CHANGING CONTAINER.

DATA: PURCHASEORDER TYPE EKKO-EBELN.

SWC_GET_ELEMENT CONTAINER 'PurchaseOrder' PURCHASEORDER.

SUBMIT ZFI_PO_RELEASE_REPORT USING SELECTION-SCREEN '1000'

WITH PurchaseOrder eq s_ebeln

AND RETURN.

  • SET PARAMETER ID 'BES' FIELD OBJECT-KEY-PURCHASEORDER.

  • CALL TRANSACTION 'ZFINREL' AND SKIP FIRST SCREEN.

END_METHOD.

Regards,

Satish

Former Member
0 Kudos

Satish,

Change it to

SUBMIT ZFI_PO_RELEASE_REPORT USING SELECTION-SCREEN '1000'
WITH s_ebeln eq PurchaseOrder
AND RETURN.

s_ebeln must be defined as parameter in the custom program.

If it is a selection list, then the format of passing values to be changed to

WITH  s_ebeln EQ s_zcltrd-low

Thanks,

Sudhir.

Former Member
0 Kudos

Thanks Sudhir.

I did realise the assignment was wrong and had changed it, but it still was not working.

I had binding issues that I fixed later on and it works alright now.

Thanks very much for your assistance.

Regards,

Satish

Answers (0)