Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

SAP Function Rule to be Executed Not Picking Parameters

$
0
0

My Workflow Rule is not passing the 3 Parameters,  belnr like  vbkpf-belnr,   bukrs like  vbkpf-bukrs and    gjahr like  vbkpf-gjahr

in the Parked Document (FIPP) so that I can access document currency amount (WRBTR in VSEGS) that I will use in my rule at the Release Amount TS00007914 step. The code below shows and am asking help on the code I can add to get this happen:

 

function zwf_parked_doc.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  TABLES

*"      ACTOR_TAB STRUCTURE  SWHACTOR

*"      AC_CONTAINER STRUCTURE  SWCONT

*"  EXCEPTIONS

*"      INVALID_USER_NAME

*"      NO_CURRENT_ORG_ASSIGNMENT

*"----------------------------------------------------------------------

 

   include <cntain>.

 

   tables: vbsegs.

 

   data: lv_doc_amount   type bwert, lv_actor type zactor, wrbtr type wrbtr, lv_belnr type  belnr_d.

   data: parked_amount(15), lv_doc_amount_me   type wrbtr.

 

   data:

           belnr like  vbkpf-belnr,

           bukrs like  vbkpf-bukrs,

           gjahr like  vbkpf-gjahr,

         

 

   swc_get_element ac_container 'CompanyCode' bukrs.

   swc_get_element ac_container 'DocumentNumber' belnr.

   swc_get_element ac_container 'FiscalYear' gjahr.

 

***  select single wrbtr  from vbsegs into wrbtr where shkzg = 'S' and belnr = belnr.

***

***  if sy-subrc = 0.

***    lv_doc_amount = wrbtr.

***  endif.

 

data var value '0'.

 

while var = 0.

 

   endwhile.

 

****  swc_get_element ac_container 'DOCUMENTNO' lv_belnr.

****

*****  get parameter id 'TotalAmount' field parked_amount.

****

*******  condense parked_amount no-gaps.

 

   select single wrbtr  from vbsegs into lv_doc_amount where shkzg = 'S' and belnr = belnr and bukrs = bukrs and gjahr = gjahr.

 

***  lv_doc_amount = parked_amount.

 

***  swc_get_element ac_container 'TOTALAMOUNT' lv_doc_amount . ""name of “your amount field in workflow container

 

   "" once you get the amount from container to lv_doc_amount u can select your table from threshold table to get actor


   select single actor into lv_actor from zthreshold_table where  threshold_from <= lv_doc_amount and threshold_to >= lv_doc_amount .

 

   if sy-subrc = 0.

 

     actor_tab-otype = 'S'.

     actor_tab-objid = lv_actor.

 

     append actor_tab.

 

   endif.

 

endfunction.


Viewing all articles
Browse latest Browse all 3184

Trending Articles