Call func 'BAPI_GOODSMVT_CREATE' problem

hi
ı have a trouble with 'BAPI_GOODSMVT_CREATE'
in this code its giving error like this "Error in function
Update control of movement type is incorrect (entry 301 X X _ Q)"
ı give manually in migo it says ok
FORM bapi.
if sy-subrc <> 0.
  message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  exit.
endif.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '04'.   "01 - MB01 - Goods Receipts for Purchase Order
loop at gt_out.
  itab-move_type  = '301'.
  itab-mvt_ind    = 'Q'.
  itab-plant      = gt_out-werks.
  itab-material   = gt_out-maktx .
  itab-entry_qnt  = gt_out-erfmg.
  itab-move_stloc = gt_out-tlgort.
  itab-stge_loc   = gt_out-flgort.
  itab-BATCH      = gt_out-charg.
  itab-WBS_ELEM   = gt_out-wbs.
  itab-VAL_TYPE   = gt_out-charg.
  gmhead-pstng_date = gt_out-postd.
gmhead-doc_date = gt_out-doc_d.
*  itab-po_number  = pcitab-pur_doc.
*  itab-po_item    = pcitab-po_item.
*  concatenate pcitab-del_no pcitab-del_item into itab-item_text.
*  itab-move_reas  = pcitab-scrap_reason.
  append itab.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
  exporting
    goodsmvt_header             = gmhead
    goodsmvt_code               = gmcode
*   TESTRUN                     = ' '
IMPORTING
    goodsmvt_headret            = mthead
*   MATERIALDOCUMENT            =
*   MATDOCUMENTYEAR             =
  tables
    goodsmvt_item               = itab
*   GOODSMVT_SERIALNUMBER       =
    return                      = errmsg
clear errflag.
loop at errmsg.
  if errmsg-type eq 'E'.
    write:/'Error in function', errmsg-message.
    errflag = 'X'.
  else.
    write:/ errmsg-message.
  endif.
endloop.
if errflag is initial.
  commit work and wait.
  if sy-subrc ne 0.
    write:/ 'Error in updating'.
    exit.
  else.
    write:/ mthead-mat_doc, mthead-doc_year.
*    perform upd_sta.
  endif.
endif.
ENDFORM.

problem resolved
change wbs element with code is below
all problems resolved
itab-val_wbs_elem   = '00009001'.
*numan p_wbs düzeltme
   itab-wbs_elem       = '00009001'.
   itab-spec_mvmt      = 'R'.
*numanitab-val_wbs_elem -->itab-wbs_elem.
*  itab-po_number  = pcitab-pur_doc.
*  itab-po_item    = pcitab-po_item.
*  concatenate pcitab-del_no pcitab-del_item into itab-item_text.
*  itab-move_reas  = pcitab-scrap_reason.
perform conversion_exit_abpsp_output
                   changing  :
                               itab-val_wbs_elem.
    perform conversion_exit_abpsp_output
                   changing  :
                              itab-wbs_elem.
form conversion_exit_abpsp_output      using p_value.
  call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
    exporting
      input  = p_value
    importing
      output = p_value.
endform.                    " CONVERSION_EXIT

Similar Messages

  • Caller screen Buttons problem Z10STL100-1

    I have Z10STL100-1 after official update Z10STL100-1/10.3.1.1565 having caller screen Buttons problem these are little above not like it's on 10.2 very below position. I security wipe and restart many times still same position of buttons? See pic attached

    Hello,
    Did you check if there are no objects on that index slide that have a fading transition? You should set the transition for every object to 'No transition'. The transition can be found in the Properties dialog, tab Options.
    Lilybiri

  • How to call function BAPI_GOODSMVT_CREATE ?

    Hi all,
    I want to create a material document by calling the function BAPI_GOODSMVT_CREATE
    I don't know what to pass although I know I have to export something (GOODSMVT_HEADER and GOODSMVT_CODE) in my ABAP. But what should I actually pass to the function?
    Thanks.

    Hi,
    Try with this
    data : gt_header like bapi2017_gm_head_01 ,
           gt_code like bapi2017_gm_code,
           gt_item like bapi2017_gm_item_create occurs 0,  
           gt_sno like bapi2017_gm_serialnumber occurs 0.
      gt_code-gm_code ='03'.  "goods issue
    In the header pass the posting date, header text etc...
    and in the line item populate material, plant, storage location, movement type.....
    IF necessary pass the serial number in the gt_sno table 
      call function 'BAPI_GOODSMVT_CREATE'
        exporting
          goodsmvt_header       = gt_header
          goodsmvt_code         = gt_code
        tables
          goodsmvt_item         = gt_item
          goodsmvt_serialnumber = gt_sno
          return                = gt_return.
    Cheers
    Sasi

  • GOODS ISSUE BAPI_GOODSMVT_CREATE problem

    Hii Alll,
    BAPI_GOODSMVT_CREATE is not posting my document but its creating material document
    and doc year.
    n i hv tested in se37 same  prob .
    its not posting production  order

    hi
    good
    go through this below code and use the functionmodule accordingly,
    The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system.
    BAPI TO Upload Inventory Data
    GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
                         02 - MB31 - Goods Receipts for Prod Order
                         03 - MB1A - Goods Issue
                         04 - MB1B - Transfer Posting
                         05 - MB1C - Enter Other Goods Receipt
                         06 - MB11
    Domain: KZBEW - Movement Indicator
         Goods movement w/o reference
    B - Goods movement for purchase order
    F - Goods movement for production order
    L - Goods movement for delivery note
    K - Goods movement for kanban requirement (WM - internal only)
    O - Subsequent adjustment of "material-provided" consumption
    W - Subsequent adjustment of proportion/product unit material
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
                                     'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
                                     'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
            include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
            include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
            include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
            include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
          errflag.
    data: begin of pcitab occurs 100,
            ext_doc(10),           "External Document Number
            mvt_type(3),           "Movement Type
            doc_date(8),           "Document Date
            post_date(8),          "Posting Date
            plant(4),              "Plant
            material(18),          "Material Number
            qty(13),               "Quantity
            recv_loc(4),           "Receiving Location
            issue_loc(4),          "Issuing Location
            pur_doc(10),           "Purchase Document No
            po_item(3),            "Purchase Document Item No
            del_no(10),            "Delivery Purchase Order Number
            del_item(3),           "Delivery Item
            prod_doc(10),          "Production Document No
            scrap_reason(10),      "Scrap Reason
            upd_sta(1),            "Update Status
          end of pcitab.
    call function 'WS_UPLOAD'
      exporting
        filename                      = p-file
        filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
      itab-move_type  = pcitab-mvt_type.
      itab-mvt_ind    = 'B'.
      itab-plant      = pcitab-plant.
      itab-material   = pcitab-material.
      itab-entry_qnt  = pcitab-qty.
      itab-move_stloc = pcitab-recv_loc.
      itab-stge_loc   = pcitab-issue_loc.
      itab-po_number  = pcitab-pur_doc.
      itab-po_item    = pcitab-po_item.
      concatenate pcitab-del_no pcitab-del_item into itab-item_text.
      itab-move_reas  = pcitab-scrap_reason.
      append itab.
    endloop.
    loop at itab.
      write:/ itab-material, itab-plant, itab-stge_loc,
              itab-move_type, itab-entry_qnt, itab-entry_uom,
              itab-entry_uom_iso, itab-po_number, itab-po_item,
                                                  pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
      TESTRUN                     = ' '
    IMPORTING
        goodsmvt_headret            = mthead
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    clear errflag.
    loop at errmsg.
      if errmsg-type eq 'E'.
        write:/'Error in function', errmsg-message.
        errflag = 'X'.
      else.
        write:/ errmsg-message.
      endif.
    endloop.
    if errflag is initial.
      commit work and wait.
      if sy-subrc ne 0.
        write:/ 'Error in updating'.
        exit.
      else.
        write:/ mthead-mat_doc, mthead-doc_year.
        perform upd_sta.
      endif.
    endif.
          FORM UPD_STA                                                  *
    form upd_sta.
      loop at pcitab.
        pcitab-upd_sta = 'X'.
        modify pcitab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          filename                      = p-file
          filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
        tables
          data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    endform.
    *--- End of Program
    reward point if helpful.
    thanks
    mrutyun^

  • After a successful home button repair, I've got a buzzing sound when I make or receive calls. No problem with the speaker as I can listen to online radio stations and my music.

    After a successful home button repair on my iPhone 4, I've got a buzzing sound when I make or receive calls. No problem with the speaker as I can listen to online radio stations and my music.

    I guess your definition of a "successful repair" is different from most people's.
    If you got it serviced by Apple, take it back to them.
    If you had it serviced by a 3rd party, Apple won't touch it. Take it back to whoeever fixed it for you.

  • Call for BAPI_GOODSMVT_CREATE inside MB_DOCUMENT_BEFORE_UPDATE

    Hi
    My requirement is -
    When I do MIGO for a outbound delivery, GR should happen simultaneously in background for a PO.
    I tried to implement interface MB_DOCUMENT_BEFORE_UPDATE where I call BAPI_GOODSMVT_CREATE
    I tried to test the BAPI independantly , It is working properly for my requirment. But when I call it inside above BADI it is giving  dump saying MB_DOCUMENT_POST called for second time.
    I guess, the problem is BAPI is trying to post the GR for PO before posting of delivery is complete.
    Please suggest options to acheive this.
    Regards
    Harshada

    Thanks for reply.
    I did create FM and called it in BADI but it gave the same result as I called BAPI directly from enhance program.
    and what do you mean 'NEW TASK'  Is that you mean call function in update task?
    I did try call function in update task but it didn't work.
    The problem is BAPI function returned that Mat XXX  Batch XXX is alreay locked by XXX and also cannot get created material doc number.

  • BAPI_GOODSMVT_CREATE Problem with movement 161

    Hi Gurus,
    I have a problem with BAPI_GOODSMVT_CREATE and movement type 161. We used to put 161 as the movement type when referencing a PO with "Returns Item" marked. Movement was properly posted. But now I am facing the following issue, when trying to post 161 I have the message "No goods receipt possible for purchase order 4200000084 ...", If I use movement type 101 system will assume 161 and everything is OK, but I don't understand why I could use 161 before and now I can´t, this is happening with all my POs with "Returns Item" marked.
    I understand that I can just use 101, the problem is that this will require a change in a non-SAP system... that is why we prefer still using 161.
    Any help will be highly appreciatted.
    Thanks!

    Hi,
    Check this link;
    Re: BAPI_GOODSMVT_CREATE for movement type 161
    Regards

  • Iphone 5 call with bluetooth (problem)

    Hi
    since I update the IOS for the IOS 8.0 I have a problem using the bluetooth in my car (Mazda 6 2008). The iPhone connects to the car bluetooth system and works fine, the only problem is when I make a call, I don't hear the ringing sound, only start to listen when the person answers the call. If the person dont answer the call I dont even know if Im making a call or not because there is no ringing sound.
    I think that this Is a problem with the IOS, it appears tha the iPhone only uses the bluetooth when the call is answer and not when I start to call.
    In the previous versions of IOS everything works fine. I've tried to restore the last backup, hard reset, reset the network configurations, remove and pair the iPhone with the car again, but nothing works.
    Anyone with the same issue?
    Thanks

    Hi rebecchina and M100 users.
    I am very happy with my M100 Plantronics due to the aural information on battery life, connected etc. I was disapointed that it didn't work for my new iPhone 5, untill I was offered to trade off with another brand but I was unsatisfied with the other bluetooth that did not have any information service. So I tried sereral was untill I got fed up with it and I held the outboard butten on the M100 for 10 seconds or so - then it connected! And it just works perfectly now
    Mike from Denmark

  • Call of Duty problem!,HELP..??

    Just got call of duty(normal version,not expansion) and can play the first 2 levels fine,when it comes for the next level to load about half way through loading i get a error message saying "max number of disconnected paths excedded",has anyone any ideas on this as im sure iv read on here before that CoD plays ok on the Intel imacs...

    I had the same problem and it's a software bug. I eventually found a mention of the problem on the developer's website (hard to find), with a very minimal, lame-*** fix that doesn't work, at least not for me. Support for this title is exceptionally poor, and it seems like if you have the problem too bad for you. I guess they are focussing more on COD 2, which so far works fine.

  • Calling Stored Procedure problem

    Hi there,
    I got a little problem with a BizTalk solutions I am building with an Oracle DB (9i) as backend:
    I need to call a stored procedure which will export the data I need to get to an export-table. The call for the sp works fine but after the call succeeded I get empty results from within the export_table. If I use SQL developer a few seconds / mins later I get the results I wanted.
    So first question: If I call a sp without return params, is it possible that the .Net code just waits if the SP could successfully be called and then works on, or does it wait until the SP successfully finished it´s work and then works on?
    Second question: If it only waits until the SP could successfully be called, is there a way to wait until the SP has finished without changing the SP?
    Thanks for your help.
    René

    Hi,
    Calling a stored procedure is not asynchronous - that is, the stored procedure completes execution before control is returned to your application.
    If, for example, you have a multi-threaded application and call the stored procedure in a worker thread the primary thread may continue executing, but I'm not sure that is what you are doing.
    - Mark

  • Trigger calling ctx_ddl.sync_index problem

    Dear,
    In order to keep my context indexes up-to-date, I'm trying to write a trigger calling this PL/SQL procedure on update/insert/delete statement.
    However, there must be a problem in my trigger definition since it gives compilation errors! I don't see what 's wrong!
    This is my trigger definition:
    =========BEGIN==================
    create or replace trigger update_lexicon_expl_nl after insert or delete or update on lexicon begin execute ctx_ddl.sync_index('lexicon_expl_nl'); end;
    =========END===================
    The compilation error is something like:
    "Encountered ctx_ddl when expecting one of the following :=.(@;immediate"
    PS. calling 'execute ctx_ddl.sync('myindex') in SQL Plus is workigng OK
    Please help.
    Dirk

    You do not need to trigger that table,there are two way to 'update' index.
    1.Alter index your_index_name rebuild.
    2.Set up background DML process, which need you work with an DBA or you have ctxsys role.

  • Call failed, echo problem, video upside down

    First I am currently in Ethiopia, for the time being I am unable to send the iPhone to the service. So just email me the solutions i might try.
    1. I don't know this is the right place to ask but any way my phone says "call failed" in the middle of talking and also it some times don't even call just display "call failed" with "call back" & "end call" option.
    2. The other think is i hear echo of my voice in the middle of conversation with other person during a call, very annoying. I tried the headset loud speaker but non of them have resolved the issue.
    3. I recorded a video in landscape mode , i.e. Volume button up; can be pressed by my right index finger, and when i transfer the video to my pc the video is inverted vertically. And i am unable to see the video properly.
    4. I saw a mac with Ethiopian calender but i can't find this in the iPhone. So since i am in Ethiopia for a while can you help me change the calendar to the Ethiopian Calender to schedule my appointments easily.
    Please help me to solve this problems, other than that the iPhone is Perfect Phone for Me!
    Thanks

    In response to Rudegar, I already checked my original movie in different browsers:
    See where I said:
    "Looks fine in chrome and safari and imovie."
    In any case, I did what I should have done before.
    I now made two very short movies, one with the home button on the right, one on the left.
    Then I tested, and it indeed is FF 4.
    All other browsers showed both movies fine.

  • Iphone 5 doesn't end call and Siri problems. Need help.

    I can barely open my screen before it closes and when I hit end call--it doesn't. The screen kicks off and goes black--anyone else experiencing this?
    Plus, Siri is acting up and doesn't get the question and the screen goes blank quickly.
    I was switched out for a new phone after all the other issues relating to lack of signal and battery drainage. So, I now have a new phone with a complete new install and now this. I have rebooted to the apple screen--nothing seems to be working to solve this.

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.
    If that doesn't help make an appointment at an App,e Store to have your iPhone looked at by a service technician.

  • Calling another BSP from a BSP using bsp:call having a Problem.

    Hi All,
    I have a BSP (page1.bsp), within Page1.bsp I am calling another BSP (Page2.bsp)
    But I need to Call Page2.bsp from Page1.bsp 'N' number of times depending upon an internal table, code is mentioned below ( Problem is mentioned after the code ) :
    LOOP AT mr_plan_comparison->mt_selected_plans ASSIGNING <fs_selected_plan>.
         CLEAR lr_plan.
         lr_plan = zcl_zpr_s_model_pool=>load_new_plan( iv_plan_id = <fs_selected_plan>-plan_id ).
         lr_plan->mr_phases = lr_plan->get_phases( ).
         lt_phases_of_a_plan = mr_plan_comparison->mt_selected_phases.
         DELETE lt_phases_of_a_plan WHERE plan_id <> <fs_selected_plan>-plan_id.
         lr_plan->mr_phases->mt_phases = lt_phases_of_a_plan.
         lv_comp_id_str = zcl_zxa_str=>conc( iv_1 = sy-tabix
                                             iv_2 = 'xyz' ).
         CONDENSE lv_comp_id_str NO-GAPS.
      %>
      <tr>
      <td>
    <htmlb:textView text="<b><%= zcl_zrm_s_data_manager=>get_name_from_id( iv_table_name = 'ZPR_PROGRAM'
                                                                         iv_field_name = 'PRG_ID'
                                                                         iv_field_value_id = <fs_selected_plan>-prg_id  ).%></b>" />
         <bsp:call   url     = "<%= zcl_zrm_co=>sc_bsp_rpphachart %>"
                     comp_id = "<%= lv_comp_id_str %>" >
    <%-- same subcontroller n times: use different component IDs --%>
        <bsp:parameter name  = "mr_plan"                  value = "<%= lr_plan %>" />
        <bsp:parameter name  = "mr_plan->MR_PHASES"       value = "<%= lr_plan->mr_phases %>" />
        <bsp:parameter name  = "mv_show_current_version"  value = "<%= abap_true %>" />
        <bsp:parameter name  = "mv_show_version_nr"       value = "<%= SPACE %>" />
    </bsp:call>
    I am able to display the Page1.bsp with no problem having Page2.bsp as well on it,
    But I have a radio button or a dropdown on Page2.bsp and when the event triggers it goes to the DO_HANDLE_EVENT of Page2.bsp whcih is correct but after DO_HANDLE_EVENT it does not go to DO_REQUEST of Page2.bsp and rather goes to Page1.bsp at the LOOP, by this what ever selection I did I am loosing those values.
    What changes should I make so that after Do_HANDLE_EVENT of Page2.bsp it should call it's Do_Request?
    I guess it might be related to the reference or something?
    Regards,
    Abhinav

    Hi Abhinav,
    the flow of nested controllers is as follows:
    contr1->do_request (here dispatch_input triggers data and event handling)
      -->contr1->do_handle_data
      -->contr2_1->do_handle_data
      -->contr2_2->do_handle_data
      -->contr2_3->do_handle_data
    ..... for all controllers in the hierarchy
      -->contrXXX->do_handle_event (the controller instance where the event was triggered)
    contr1->do_request continued
    call view for contr1
      -->contr2_1->do_request
      -->contr2_2->do_request
      -->contr2_3->do_request
    .... for all subcontrollers called by your logic
    the dispatch_input in the subcontroller does not have any effect as within the method it is checked whether the controller is a root controller or not.
    In case you call the subcontroller with the same component ID's than you called them before, the same instances are reused. So if you reuse the instances and set an attribute within the instance that handled the event you should be able to "remember" the values.
    Another option is to write the event back either to the application class or to the parent controller (is available via attribute m_parent) and hand it back over to the controller during the calling loop.
    Hope that helps.
    Best Regards
    Michael

  • Caller Display Charging Problem

    This is now the 3rd month in a row I have been charged for Caller Display, I have contacted the Indian online live chat twice previously but the problem still persists, can someone here get to the bottom of this and refund me the sums I have been overcharged and sort it out so that I don't get charged next month?

    Hi beseeinyou,
    I'll be able to pick this up from here and get you sorted.  Sorry that you're still being charged despite contacting us twice to stop that happening.
    Click on my username and under the "about me" section of my profile you'll see the link to send over your details.
    Cheers,
    Robbie
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

Maybe you are looking for

  • Handling illegal characters in file and folder names

    Due to the cross-platform nature of our DAM, some characters which are valid on OSX are not valid on our DAM, like :*?\"<>|;#. So I want to prevent that users using our Drive connector create files or folders containing these characters. Is it possib

  • Hi My photoshop CS6 is not supporting Photomerge

    Hi my photoshop cs6 is not supporting for photomerge, while i am trying with it its showing error 46

  • FCE file suddenly won't open; FCE crashes

    A FCE 3.5.1 project that I've been working on for months, suddenly crashes the application. The file is 3.5Mb. It opens to 48%, says it's "preparing video for display", and then "FCE quit unexpectedly". Other projects open fine. I've removed preferen

  • Dell N2048P - Failed logins

    Hi allOur organisation recently had all it's swithces replaced with Dell N2048P's. In the logs on all of them I see constant failed login attempts for root, admin, and at least one of our user names.The logs are pretty unhelpful as that is all they s

  • Sync speaker systems macbook

    A fellow has a Logitech Z623 speaker system and a LG CM4630 500w  speaker system and every time he plays music with them both on, the  sound isn't synced correctly (to break this down, if you play music one  speaker system makes starting beat first a