<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Web Services thru Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005766#M1607173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Your getting the confirmation number using this bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'
    EXPORTING
      BFLUSHFLAGS          = L_FLAGS
      BFLUSHDATAGEN        = L_GENDATA
      BFLUSHDATAMTS        = L_SPCDATA
   IMPORTING
      CONFIRMATION         = CONFIRMATION " Here ur getting Confirmation Number
      RETURN               = RETURN
*           TABLES
*             SERIALNR             =
     GOODSMOVEMENTS       = GM.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where your getting material Document Number?&lt;/P&gt;&lt;P&gt;Where your passing MATERIAL_DOC = material Document number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I search Your code MATERIAL_DOC is not present. Your passing the confirmation number only Not a material Docu Number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you got the Document Number Pass the value like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MATERIAL_DOC = ."Here you have to pass the value 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jun 2011 06:41:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-14T06:41:55Z</dc:date>
    <item>
      <title>Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005765#M1607172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a remote-enabled function module which simulates the MFBF transaction as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Import Parameters:
I_WERKS type WERKS
I_MATNR type MATNR
I_QTY     type ERFMG
I_UOM     type  SA_ERFME
I_VERID   type VERID
I_BUDAT type BUDAT
I_HDRTXT type BKTXT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Export Parameters:
CONFIRMATION type PRTNR
MATERIAL_DOC type MBLNR
RETURN type BAPIRET2&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Source code:
TABLES:  ZWS_ERR.
  DATA:  WA_ZWS_ERR TYPE ZWS_ERR.
  DATA:  L_FLAGS   TYPE BAPI_RM_FLG,
         L_GENDATA TYPE BAPI_RM_DATGEN,
         L_SPCDATA TYPE BAPI_RM_DATSTOCK.

  DATA:  BEGIN OF GM OCCURS 0.
          INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE.
  DATA:  END OF GM.
  DATA: L_TMSTMP(11) TYPE p DECIMALS 7.
  DATA: L_LOW TYPE TVARV_VAL.

*Make to Stock Scenario:

*check to see if we need to capture successful calls:
  select SINGLE low INTO L_LOW
  FROM tvarvc
     where name = 'ZWS_MTS_GD'
           AND LOW = 'X'.


  IF I_WERKS IS INITIAL.
    I_WERKS = '0010'.
  ENDIF.
  L_FLAGS = '01'.

  L_GENDATA-MATERIALNR  = I_MATNR.
  L_GENDATA-PRODPLANT   = I_WERKS.
  L_GENDATA-PRODVERSION = I_VERID.
  L_GENDATA-BACKFLQUANT = I_QTY.
  L_GENDATA-UNITOFMEASURE = I_UOM.
  L_GENDATA-DOCHEADERTXT = I_HDRTXT.
  L_GENDATA-POSTDATE = I_BUDAT.
  L_GENDATA-DOCDATE  = SY-DATUM.

  CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'
    EXPORTING
      BFLUSHFLAGS          = L_FLAGS
      BFLUSHDATAGEN        = L_GENDATA
      BFLUSHDATAMTS        = L_SPCDATA
   IMPORTING
      CONFIRMATION         = CONFIRMATION
      RETURN               = RETURN
*           TABLES
*             SERIALNR             =
     GOODSMOVEMENTS       = GM.


* Commit or rollback the bapi
  if CONFIRMATION ne '0000000000'.
    call function 'BAPI_TRANSACTION_COMMIT'.

*Capture "successful" calls in table to track usage
*for initial deploymnet (testing, monitoring, etc.)
*To turn off - Set TVARVC variable ZWS_MTS_GD to initial
    IF L_LOW EQ 'X'.
      get time stamp field L_TMSTMP.
      WA_ZWS_ERR-MANDT = SY-MANDT.
      WA_ZWS_ERR-TIMESTAMP = L_TMSTMP.
      WA_ZWS_ERR-WERKS = I_WERKS.
      WA_ZWS_ERR-MATNR = I_MATNR.
      WA_ZWS_ERR-BACKFLQUANT = I_QTY.
      WA_ZWS_ERR-UOM = I_UOM.
      WA_ZWS_ERR-VERID = I_VERID.
      WA_ZWS_ERR-BUDAT = I_BUDAT.
      WA_ZWS_ERR-HDRTXT = I_HDRTXT.
      WA_ZWS_ERR-TYPE = RETURN-TYPE.
      WA_ZWS_ERR-ID = RETURN-ID.
      WA_ZWS_ERR-MSGNO = RETURN-NUMBER.
      WA_ZWS_ERR-MESSAGE = CONFIRMATION.
      WA_ZWS_ERR-ERNAM = SY-UNAME.
      WA_ZWS_ERR-ERDAT = SY-DATUM.
      WA_ZWS_ERR-ERZET = SY-UZEIT.
      INSERT ZWS_ERR FROM WA_ZWS_ERR.
    endif.
  else .

*Do not send application errors back to calling application!!
*Application Errors will be handled in SAP, so store the errors in table ZWS_ERR
*And then clear RETURN
    call function 'BAPI_TRANSACTION_ROLLBACK' .
    get time stamp field L_TMSTMP.
    WA_ZWS_ERR-MANDT = SY-MANDT.
    WA_ZWS_ERR-TIMESTAMP = L_TMSTMP.
    WA_ZWS_ERR-WERKS = I_WERKS.
    WA_ZWS_ERR-MATNR = I_MATNR.
    WA_ZWS_ERR-BACKFLQUANT = I_QTY.
    WA_ZWS_ERR-UOM = I_UOM.
    WA_ZWS_ERR-VERID = I_VERID.
    WA_ZWS_ERR-BUDAT = I_BUDAT.
    WA_ZWS_ERR-HDRTXT = I_HDRTXT.
    WA_ZWS_ERR-TYPE = RETURN-TYPE.
    WA_ZWS_ERR-ID = RETURN-ID.
    WA_ZWS_ERR-MSGNO = RETURN-NUMBER.
    WA_ZWS_ERR-MESSAGE = RETURN-MESSAGE.
    WA_ZWS_ERR-ERNAM = SY-UNAME.
    WA_ZWS_ERR-ERDAT = SY-DATUM.
    WA_ZWS_ERR-ERZET = SY-UZEIT.
    INSERT ZWS_ERR FROM WA_ZWS_ERR.
    CLEAR RETURN.

  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I test my FM, I am getting confirmation number&lt;STRONG&gt;(It is working fine till here)&lt;/STRONG&gt; But I don't see any material document number. &lt;/P&gt;&lt;P&gt;Have I done anything wrong? Please suggest me in such a way that I need my material document number also get populated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 21:55:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005765#M1607172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-13T21:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005766#M1607173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Your getting the confirmation number using this bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'
    EXPORTING
      BFLUSHFLAGS          = L_FLAGS
      BFLUSHDATAGEN        = L_GENDATA
      BFLUSHDATAMTS        = L_SPCDATA
   IMPORTING
      CONFIRMATION         = CONFIRMATION " Here ur getting Confirmation Number
      RETURN               = RETURN
*           TABLES
*             SERIALNR             =
     GOODSMOVEMENTS       = GM.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where your getting material Document Number?&lt;/P&gt;&lt;P&gt;Where your passing MATERIAL_DOC = material Document number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I search Your code MATERIAL_DOC is not present. Your passing the confirmation number only Not a material Docu Number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you got the Document Number Pass the value like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MATERIAL_DOC = ."Here you have to pass the value 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 06:41:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005766#M1607173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T06:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005767#M1607174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the response. The bapi ('BAPI_REPMANCONF1_CREATE_MTS'&lt;/P&gt;&lt;P&gt;)from which I am getting the confirmation number doesn't have a material document field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I have retrieved the value of material_doc value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR: GV_MATERIAL_DOCUMENT.
    SELECT MBLNR INTO GV_MATERIAL_DOCUMENT FROM MKPF
                                           WHERE BUDAT EQ I_BUDAT
                                             AND BLDAT EQ SY-DATUM.
    ENDSELECT.
    IF SY-SUBRC = 0.
      WA_ZWS_ERR-MBLNR        = GV_MATERIAL_DOCUMENT.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still when I test my FM I get the confirmation number and the material_doc field is not populated. That is where I am confused. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 13:31:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005767#M1607174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T13:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005768#M1607175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Your getting the material Document number using this field GV_MATERIAL_DOCUMENT right. Just pass the field value to &lt;/P&gt;&lt;P&gt;MATERIAL_DOC like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR: GV_MATERIAL_DOCUMENT.
    SELECT MBLNR INTO GV_MATERIAL_DOCUMENT FROM MKPF
                                           WHERE BUDAT EQ I_BUDAT
                                             AND BLDAT EQ SY-DATUM.
    ENDSELECT.
    IF SY-SUBRC = 0.
*      WA_ZWS_ERR-MBLNR        = GV_MATERIAL_DOCUMENT."instead of this 
      MATERIAL_DOC = GV_MATERIAL_DOCUMENT."use this st. to get the material docu num
    ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the sy-subrc it will return 0 or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 04:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005768#M1607175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T04:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005769#M1607176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Your getting the material Document number using this field GV_MATERIAL_DOCUMENT right. Just pass the field value to &lt;/P&gt;&lt;P&gt;MATERIAL_DOC like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR: GV_MATERIAL_DOCUMENT.
    SELECT MBLNR INTO GV_MATERIAL_DOCUMENT FROM MKPF
                                           WHERE BUDAT EQ I_BUDAT
                                             AND BLDAT EQ SY-DATUM.
    ENDSELECT.
    IF SY-SUBRC = 0.
*      WA_ZWS_ERR-MBLNR        = GV_MATERIAL_DOCUMENT."instead of this 
      MATERIAL_DOC = GV_MATERIAL_DOCUMENT."use this st. to get the material docu num
    ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the sy-subrc it will return 0 or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 04:20:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005769#M1607176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T04:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Web Services thru Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005770#M1607177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot. I got the required output. I am closing this thread. Points assigned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 13:55:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/web-services-thru-function-module/m-p/8005770#M1607177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-15T13:55:38Z</dc:date>
    </item>
  </channel>
</rss>

