cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI BAPI_INSPLOT_SETUSAGEDECISION can't change the document posting date

0 Kudos

Hi All,

I have a problem.Our abaper develops a function module that integrates the Goods receipt to QI stock and set usage decision posting the QI stock to unrestricked stock together.And we get a problem.If we post the GR in the next month,when the fm execute the second step there will be a problem.I  think it's caused by deficit of project stock QI prev period.But we can't find the import parameter of document post date of the bapi.So anyone know how to deal with the problem.Thanks a lot

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ye Wan,

I am using the same BAPI and its working for the date the user confirms it.

You can find the code below.

"" GET DETAILS IN TABLE QPAC ""

   st_SetUsg_BAPI-wa_UD_DATA-INSPLOT             = st_Sel-INSPLOT.

   st_SetUsg_BAPI-wa_UD_DATA-UD_SELECTED_SET     = '03'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_CODE             = 'A'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_CODE_GROUP       = '03'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_PLANT            = '0001'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_RECORDED_BY_USER = SY-UNAME.

   st_SetUsg_BAPI-wa_UD_DATA-UD_RECORDED_ON_DATE = SY-DATUM.

   st_SetUsg_BAPI-wa_UD_DATA-UD_RECORDED_AT_TIME = SY-TIMLO.

   st_SetUsg_BAPI-wa_UD_DATA-UD_TEXT_LINE        = 'Confirmation'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_FORCE_COMPLETION = 'X'.

   st_SetUsg_BAPI-wa_UD_DATA-UD_STOCK_POSTING    = 'X'.

   st_SetUsg_BAPI-wa_LANGUAGE-LANGU              = 'E'.

   st_SetUsg_BAPI-wa_LANGUAGE-LANGU_ISO          = 'EN'.

   CALL FUNCTION 'BAPI_INSPLOT_SETUSAGEDECISION'

     EXPORTING

       NUMBER         = st_Sel-INSPLOT

       UD_DATA        = st_SetUsg_BAPI-wa_UD_DATA

       LANGUAGE       = st_SetUsg_BAPI-wa_LANGUAGE

     IMPORTING

       UD_RETURN_DATA = st_SetUsg_BAPI-wa_UD_RETURN_DATA

       STOCK_DATA     = st_SetUsg_BAPI-wa_STOCK_DATA

       RETURN         = st_SetUsg_BAPI-wa_RETURN.

Hope it helps,

Regards,

Anirudh.

0 Kudos

Hi Anirudh,

You mean the UD_DATA-UD_RECORDED_ON_DATE can control the red blank posting date on my attached pic.

We try it once,but it seem not work.If you used to control the posting date of 321 material document by the import parameter,we will try it again.

Former Member
0 Kudos

Hi , I don't think that date  field can be found in that BAPI.

Regards,
Anirudh.