Hello all.
I am hoping to get some guidance on an issue I currently am having with an SAP integration. Since I am not an ABAP programmer, I am not even sure if what I am trying to do is feasible.
Here is the scenario. A third party application calls SAP via a web service. This web service creates an SAP Workflow item in a users business workflow inbox. This web service also passes along several container values which I am trying to populate the screen with when the workflow is executed. The work item creates a MIRO transaction, The program code for the business object, in my case ZOBBUS2081, calls a custom function module that I have created and maps the values stored in the work items' containers to the MIRO transactions' screen elelements..
This works for the most part. By that I mean that, when I execute the work item, I open a MIRO transaction and the values are transferred to the screen elements properly. However, there are certain work items that get created where there is a container element meant to block payment on the PO. The only differences here are that this screen value is a drop down as opposed to the other screen elements, which are simply text boxes, and this value is on the Payment tab of MIRO, where the rest of the transferred values are contained on the Basic Data tab. When I try to execute a work item which is intended to be blocked for payment, this value is not passed at all. The value of this container is simply 'A', which should
set the value "Blocked for payment". (The screen element is called "Pmnt block".
Below I have pasted my function module code. The lines which represent this dropdown screen element are 80 and 81. Also, the Z* elements in the bdc commands represent the container values I have passed to this function module. Any comments and/or suggestions are greatly appreciated.
FUNCTION Z_OB_MIRO_MCONTAINER.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'A'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID DEFAULT 'ZONBASE'
*" VALUE(USER) LIKE APQI-USERID DEFAULT SY-UNAME
*" VALUE(KEEP) LIKE APQI-QERASE DEFAULT 'X'
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE DEFAULT SY-DATUM
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(VORGANG_001) LIKE BDCDATA-FVAL DEFAULT '1'
*" VALUE(ZPROPINVOICEDATE) LIKE BDCDATA-FVAL DEFAULT '20150107'
*" VALUE(ZPROPPOSTINGDATE) LIKE BDCDATA-FVAL DEFAULT '20150107'
*" VALUE(ZPROPINVOICEAMOUNT) LIKE BDCDATA-FVAL DEFAULT 100
*" VALUE(ZPROPTAXCODE) LIKE BDCDATA-FVAL DEFAULT 'I0'
*" VALUE(REFERENZBELEGTYP_006) LIKE BDCDATA-FVAL DEFAULT '1'
*" VALUE(ZPROPPONUMBER) LIKE BDCDATA-FVAL DEFAULT '4701203729'
*" VALUE(ZPROPPOAMOUNT) LIKE BDCDATA-FVAL DEFAULT 100
*" VALUE(ZPROPPOQUANTITY) LIKE BDCDATA-FVAL DEFAULT '1'
*" VALUE(ZPROPSAPCOMPANYCODE) LIKE BDCDATA-FVAL DEFAULT 'C109'
*" VALUE(ZPROPINVOICENUMBER) LIKE BDCDATA-FVAL DEFAULT '1322'
*" VALUE(ZPROPTAXAMOUNT) LIKE BDCDATA-FVAL DEFAULT '0.00'
*" VALUE(ZPROPSAPCURRENCY) LIKE BDCDATA-FVAL DEFAULT 'USD'
*" VALUE(LIFNR_010) LIKE BDCDATA-FVAL DEFAULT '5304'
*" VALUE(ZBLOCK) LIKE BDCDATA-FVAL DEFAULT 'A'
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL
*"----------------------------------------------------------------------
* type-pools: VRM.
data l_buk like bkpf-bukrs.
subrc = 0.
perform bdc_nodata using NODATA.
perform open_group using GROUP USER KEEP HOLDDATE CTU.
perform bdc_dynpro using 'SAPLMR1M' '6000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RM08M-VORGANG' VORGANG_001.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
INPUT = ZPROPINVOICEDATE
IMPORTING
OUTPUT = ZPROPINVOICEDATE.
perform bdc_field using 'BDC_CURSOR' 'INVFO-BLDAT'.
perform bdc_field using 'INVFO-BLDAT' ZPROPINVOICEDATE.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
INPUT = ZPROPPOSTINGDATE
IMPORTING
OUTPUT = ZPROPPOSTINGDATE.
perform bdc_field using 'INVFO-BUDAT' ZPROPPOSTINGDATE.
perform bdc_field using 'INVFO-XBLNR' ZPROPINVOICENUMBER.
perform bdc_field using 'INVFO-WRBTR' ZPROPINVOICEAMOUNT.
perform bdc_field using 'INVFO-WAERS' ZPROPSAPCURRENCY.
perform bdc_field using 'INVFO-WMWST' ZPROPTAXAMOUNT.
perform bdc_field using 'RM08M-REFERENZBELEGTYP' REFERENZBELEGTYP_006.
perform bdc_field using 'BDC_CURSOR' 'RM08M-EBELN'.
perform bdc_field using 'RM08M-EBELN' ZPROPPONUMBER.
perform bdc_dynpro using 'SAPLMR1M' '6610'.
perform bdc_field using 'BDC_CURSOR' 'RM08M-LIFNR'.
perform bdc_field using 'RM08M-LIFNR' LIFNR_010.
perform bdc_dynpro using 'SAPLMR1M' '6000'.
perform bdc_field using 'BDC_OKCODE' '=HEADER_PAY'.
perform bdc_field using 'BDC_CURSOR' 'INVFO-ZFBDT'.
perform bdc_field using 'BDC_CURSOR' 'INVFO-ZLSPR'.
perform bdc_field using 'INVFO-ZLSPR' ZBLOCK.
perform bdc_transaction tables messtab
using 'MIRO'
CTU
MODE
UPDATE.
if sy-subrc <> 0.
subrc = sy-subrc.
exit.
endif.
perform close_group using CTU.
ENDFUNCTION.
Thanks in advance!
- Kurt Kapferer