Set Commodity Code in Purchase order

hello,
I have implemented a BADi for purchase order for updating the commodity code/weight and Volume from material configuration.
It works fine with updating for weight and volume. But when trying to update the Commodity code I got a "time out" because it stops just before the call "CALL Method->Set_foreign_trade".
Do I miss something???
See the codes below.
METHOD if_ex_me_process_po_cust~process_item .
  DATA: ls_mepoitem TYPE mepoitem.
  DATA: it_conf TYPE TABLE OF conf_out.
  DATA: wa_conf TYPE conf_out.
  DATA: gs_zvcsd_conf TYPE zvcsd_conf.
  DATA: im_data TYPE mepoitem.
  DATA: l_data_new  TYPE mepoitem.
  DATA: lv_mtart TYPE mtart.
  DATA: len TYPE i.
  DATA: ls_mepo_eipo TYPE mepo_eipo.
  DATA: ls_mepo_eipo_new TYPE mepo_eipo.
Get data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ls_mepoitem = im_item->get_data( ).
check entry from control table zvcsd_conf
  SELECT SINGLE * FROM zvcsd_conf INTO gs_zvcsd_conf
  WHERE matnr EQ ls_mepoitem-matnr.
  CHECK sy-subrc = 0.
  SELECT SINGLE mtart
  FROM mara
  INTO lv_mtart
  WHERE matnr EQ ls_mepoitem-matnr.
  CHECK lv_mtart EQ  'KMAT'.
  CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'
    EXPORTING
      instance           = ls_mepoitem-cuobj
      language           = sy-langu
    TABLES
      configuration      = it_conf
    EXCEPTIONS
      instance_not_found = 1
      OTHERS             = 2.
  CHECK sy-subrc =  0.
check weight is set from control table
  IF NOT gs_zvcsd_conf-zweight IS INITIAL.
    READ TABLE it_conf INTO wa_conf WITH KEY atnam = 'VCSD_ZNTGEW'.
    IF sy-subrc = 0.
      len = STRLEN( wa_conf-atwrt ).
      IF len LE 7.
        REPLACE ',' WITH '.' INTO wa_conf-atwrt.
      ELSE.
        REPLACE '.' WITH ' ' INTO wa_conf-atwrt.
        REPLACE ',' WITH '.' INTO wa_conf-atwrt.
        CONDENSE wa_conf-atwrt NO-GAPS.
      ENDIF.
      ls_mepoitem-ntgew = wa_conf-atwrt.
      ls_mepoitem-brgew = wa_conf-atwrt.
    ENDIF.
  ENDIF.
check volume is set from control table
  IF NOT gs_zvcsd_conf-zvolum IS INITIAL.
    READ TABLE it_conf INTO wa_conf WITH KEY atnam = 'VCSD_ZVOLUM'.
    IF sy-subrc = 0.
      len = STRLEN( wa_conf-atwrt ).
      IF len LE 7.
        REPLACE ',' WITH '.' INTO wa_conf-atwrt.
      ELSE.
        REPLACE '.' WITH ' ' INTO wa_conf-atwrt.
        REPLACE ',' WITH '.' INTO wa_conf-atwrt.
        CONDENSE wa_conf-atwrt NO-GAPS.
      ENDIF.
      ls_mepoitem-volum =  wa_conf-atwrt.
      ls_mepoitem-voleh = gs_zvcsd_conf-voleh.
    ENDIF.
  ENDIF.
Set weight and volume
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  l_data_new = ls_mepoitem.
  CALL METHOD im_item->set_data( im_data = l_data_new ).
End of get data
Get commodity code from configuration
  IF NOT gs_zvcsd_conf-zstawn IS INITIAL.
    READ TABLE it_conf INTO wa_conf WITH KEY atnam = 'VCSD_STAWN'.
    IF sy-subrc = 0.
      ls_mepo_eipo_new-stawn = wa_conf-atwrt.
    ENDIF.
  ENDIF.
Get foreign trade data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CALL METHOD im_item->get_foreign_trade
     RECEIVING
        re_data = ls_mepo_eipo.
  ls_mepo_eipo-po_item = ls_mepoitem-ebelp.
  ls_mepo_eipo-stawn = ls_mepo_eipo_new-stawn.
set foreign trade
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CALL METHOD im_item->set_foreign_trade
    EXPORTING
      im_data = ls_mepo_eipo.
ENDMETHOD.

hello Christian,
Thank you for your comments and the quick response.
I have solved my problem now. I found two sap notes regarding this situation.
841803 -
ME_PROCESS_PO_CUST: Endless loop with SET_FOREIGN_TRADE
803749 -
ME_PROCESS_PO_CUST - Endless Loop
I also have found out an other thing. When I'm using the SAP Notes Search and type the key word "SET_FOREIGN_TRADE" and "ME_PROCESS_PO_CUST" I found nothing. Then I try to create a Customer Message and as you already knew that you have to enter a some words in the "Search term*"  before you are allowed to create a customer message. The system shows the note 841803. Strange, rite?
So my conclusion is, if I can't find any note from SAP Notes Search then I will try to create an customer message.
Best regards
Linh Nguyen

Similar Messages

  • Additional field(company code) in purchase order screen layout

    Hi All experts,
    I have a requirement to set the company code in Purchase order as display field during PO creation or change.
    I have checked in IMG under screen layout for purchase order but  there is no company code field available.
    How can I add the additional field into the screen layout.
    Any inout will be highly appreciated.
    Thank you in advance
    Lost.

    Hi Chee Wan Ng,
    <b>Where</b> exactly you want to set the Company Code field in the Purchase order? Actually this field is already available under <b>Org.data</b> tab in the Purchase Order Creation transaction (ME21N), so you may not require to set the Company Code again.
    Which version of SAP R/3 you are using?
    Hope this helps you, if not, then give us more details to help you better.
    Good luck.

  • PROCESS CODE  FOR  PURCHASE ORDER

    Hi Friends,
        what is the process code for Purchase order...  because  i need to   creating a  partner profile in WE20 in the inbound side.. if iselect  message type   ORDERS menas.. that related.. process code( for purchase order is not  displaying)..
      can  any of you give me the <b>Message type </b> and that related <b>Process code</b> for <b> purchase order</b>..
    thanks
    Babu

    Hi Babu,
        You will find out the all Process Code from WE41 for Outbound & WE42 for Inbound.
    The Process code for ORDERS: Purchase order is ME10 for Outbound and you can find it out the message type for Inbound from WE42.
    If need more info let me know..
    Cheers
    Veera

  • How Create new Tax code in Purchase order

    Dear Sir,
    I have creat new tax code in Purchase order
    Basic value          3976876.53
    Ex Duty          10%     397687.6525
    edu.cess          2%     7953.75305
    s&h Edu.cess     1%     3976.876525
    Toatal               4386494.81
    CST          1%     43864.94807
    Addition                12550.00
    i have all ready tax code 1021+5vat

    Hi Sneha Patel
    Case1:
    If tax is applicable on the freight charges then create a Z condition in (Tocde M/06) and assign it in ur pricing  procedure (Tocde M/08) before the net value is calculated in ur pricing procedure so that it is taken for tax calculation.
    Case2:
    If tax is  not applicable on the freight charges then create a Z condition in (Tocde M/06) and assign it in ur pricing  procedure (Tocde M/08) after the net value is calculated in ur pricing procedure so that it is not taken for tax calculation.
    For both the conditions select
    Cond. class   A Discount or surcharge
    Calculat.type B Fixed amount
    Cond.category B Delivery costs
    Also mark as a header or item condition with accruals checked.
    If u are not sure then copy FRA1 condition in STD and change Calculat.type  as B Fixed amount instead of % in FRA1 so that u can enter the amount directly in PO.
    Also mark these conditions as manual in ur pricing procedure so that these can be entered manuall in PO if reqd.
    While creating PO u can select the reqd condition (with or without tax) under conditions tab and enter the amount.
    hope it clears ur issue
    Chk and revert
    Reg
    Raja

  • Output Tax Code In Purchase Order

    Hi all,
    It's possible to assign an output tax code to a purchase order?
    The system gives me the error message 6164 'Please enter an input tax code, not an output tax code' when I use an output tax . Is there any customization to allow output taxes in purchase orders?
    Thank you,
    RS

    Dear friend...
    You cannot use output tax code in purchase order, since output tax codes are used only for sales. If you use output tax code in the PO it will obviously throw the error you said. If you want to have the taxes as shown in the output taxes, if not present in  your input tax codes, you can create new tax code which you desire. Output codes are only for the Sales Order.
    Hope it helps re-ward if so
    Suraj

  • PS - Set Commitment only for Purchase order

    Hi experts,
    I would like to know if its possible set in the Customizing, the  Commitment just for Purchase Order.
    Because, currently we have fixed Purchase Requisition and Purchase Order.
    Thanks in advance.
    Nacho

    Hi,
    SAP Note:955107 addresses this problem. You may refer the note, but for easy reference, relevant portios of the note are quoted below:
    Quote begins:
    Symptom
    The purchase requisition commitment should not be taken into account in the availability control.
    How can this be achieved?
    Reason and Prerequisites
    This is a customer request.
    It should be possible to enter purchase requisitions with any amount and only the resulting purchase orders should be checked by an availability control.
    Solution
    For Releases 4.6C, 4.70, 5.00 and 6.00 first implement the corrections from Note 955106 if you have not already done this.
    Afterwards proceed as follows.
    1. Create a utility program ZBPFCI21 of the 'Subroutine Pool' type. For the source code of the program refer to the attached correction instruction 488705.
                  Caution: Do not use a different name than ZBPFCI21.
    2. Adjust the source code within the utility program ZBPFCI21 as follows:
                  When the residual order plan should not be included in the assigned value of the availability control, activate the line
                           CLEAR cd_flag_pr_commitment_avac.
                  (That is, delete the sign '*' in front of the line.)
    3. Save and activate the ZBPFCI21 utility program.
    4. Reconstruct the assigned values of the availability control (Transactions KO31 for orders or CJBN for projects).
    Quote ends.
    Kindly acknowledge, if it meets your requirement.
    Muraleedharan.R

  • How to show CVD as CENVATABLE (ie with set-off) in Import Purchase Order

    Dear Sir,
    In our existing SAP system , the Import Purchase having CVD are showing CVD as Delivery Cost . However we desire that CVD being CENVATABLE should get reflected with a Set-off  in the similar fashion as  cenvatable EXCISE-DUTY is being shown incase of DOMESTIC Purchase Order .
    We request you to kindly pl guide us about this pl .
    With Regards
    Sonia Agarwal

    Hi friends
    As suggested  in the posted reply , I have done following :
    a) For CVD condition , Maintained accrual as FR3 in pricing procedure
    b) Tick the condition as Statistical
    c) In J1ID maintained Material as Raw-material
    But still , the net value appearing in Purchase Order , includes the CVD .
    Kindly guide us pl .
    Regards
    Sonia Agarwal

  • Vendor code in Purchase order changed after invoice,net price showing zero.

    Dear Experts ,
    In one purchase order , user had done GR & invoice for a line item ( service ),item category "D" , and
    thereafter somehow the system allowed user to change the vendor code. The PO line is now having amounts in
    the sub-service line items , but net price for the line item is showing as zero. Since the PO was made
    directly without any contract/RFQ/PR , there is no reference document or info record shown against the line
    item.
    In the conditions tab of Item details,the condition for basic price is not seen & since there are no amounts
    applicable for the other conditions such as insurance , octroi etc., the NET price shown for the item is
    Zero, which is also getting printed in the PO as zero , which is not acceptable , as we can not send to the
    vendor PO copy having prices for individual services printed correctly but the total gross price showing
    zero.
    Pl advise what can be done so that Net Price is shown correctly & not zero.

    I think the new vendor is having a different pricing schema than the old vendor. Check the pricing schema for the old vendor (in purchasing view in field 'Schema Group. vendor) and compare it to the new vendor. I think they're different.
    If it is then what i think happening is the user already input the price for the condition type in pricing schema A, then the vendor is changed and the new pricing schema is kiciking in thus making the old condition type missing.
    Try to either:
    A. Change to the old vendor back,
    B. Change the pricing schema of the new vendor to be the same with old vendor

  • BAPI for updating tax code for purchase order..

    Hi friends,
      I have one requirement to change tax code for multiple Purchase order but the
    thing is they should not go for release.So what should I prefer BDC or BAPI.
      I am thinking to implement it through BAPI, but I don't know what procedure to follow.
    If somebody can provide me a small guiding steps or code then it will be very helpful for me..
    Thnaks in advance..
    Useful answers will be rewarded with points....
    Regards,
    Rajesh Akarte

    Hi Friend,
    BAPI_ACC_PURCHASE_ORDER_CHECK  Accounting: Check Purchase Order                                         
    BAPI_ACC_PURCHASE_ORDER_POST   Accounting: Post Purchase Order  
    MEWP                           BAPIs Purchase order                                                     
    BAPI_PO_CREATE                 Create Purchase Order                                                    
    BAPI_PO_GETDETAIL              Display Purchase Order Details                                           
    BAPI_PO_GETITEMS               List Purchase Order Items                                                
    BAPI_PO_GETITEMSREL            List Purchase Orders for Release (Approval): New as of 4.0A              
    BAPI_PO_GETRELINFO             Display Detailed Release (Approval) Information on Purchase Order        
    BAPI_PO_GET_LIST               List Purchase Orders - Only up to 4.0A                                   
    BAPI_PROCOPERATION_GETCATALOGS Determine Valid Catalogs as Value Help                                   
    BAPI_PROCOPERATION_GETINFO     Analysis of Objects to be Generated in Purchasing                        
    <b>AND</b>
    Use condition type NAVS with access sequence 0003 to default the taxcode in the purchase order item using conditions. Materials Management -> Purchasing -> Purchasing order processing ->define screen layout at document level. Search for the transaction ME21.Double click on ME21. Then search for TaxCode
    Use condition type NAVS with access sequence 0003 to default the taxcode in the purchase order item using conditions.
    A2: Go to IMG.
    Materials Management -> Purchasing -> Purchasing order processing ->define screen layout at document level.
    Search for the transaction ME21.Double click on ME21. Then search for TaxCode. It is advisable to configure also the info record. The tax code should be a required entry, and whatever you specify here will be the default value in the Purchase order.
    Materials Management -> Purchasing -> Purchasing info record -> define screen layout.
    When you get here you search for the transaction ME12 ,double click here; search for Input VAT indicator.
    Regards ,
    Kumar.

  • Validation of Tax Codes in Purchase Order

    Dear All,
    We have different tax codes like v0, v1, v2 maintained in system and we have projects(WBS) like Project1, Project2 etc. 
    The scenario is such that if i am trying to create an account assigned purchase order for a project with account assignement as Project1, system should allow only tax code v1.  System should not allow other tax codes for project1.
    Can we have tax code validation with respect to projects during PO creation. 
    Request, please provide steps that are required to mainatined to achive the above.
    regards,
    Suresh

    Hi Suresh,
    You can use SMOD enhancement MM06E005 component EXIT_SAPMM06E_012. This user exit is designed for checking custom data on the purchase order header, but can also be used for checking the standard PO data.
    Some of the tables passed to the user exit are TEKPO and TEKKN, all items of the purchasing document and all account assignments, so you can compare the tax code with the project and produce an error message if the combination is incorrect.
    Regards,
    Monika

  • Setting for Sending the purchase order via EDI

    Hi,
    I have no knowledge on the Sending the Purchase Order via EDI.
    What is the setting that need to do in MM side?
    Anyone has any idea?

    Hello Janice,
    Please refer the below LINKs which would provide you clear approach for configurational task of sending PO through EDI.
    [LINK|http://help.sap.com/saphelp_46c/helpdata/en/dc/6b7c9f43d711d1893e0000e8323c4f/frameset.htm]
    [LINK 2|http://www.erpgenie.com/sapgenie/docs/advanced_guide_to_edi_configuration.doc]
    Regards,
    SARTHAK

  • Danger of using old tax code in purchase order

    Materials management, Finance and controlling modules are active in
    system.we have created new tax codes at the end of Dec 2007 in system
    as per the legal requirement.Also condition types are maintianed with
    validity period. We have updated existing purchase orders (which are
    going to be continued in year 2008) with new tax codes.
    But now if by mistake while creating purchase order, user picks up old
    tax code and saves PO, system does not give any error.
    Is there any way by which we can restrict using of old tax codes at the
    time of creating / changing Purchase orders?
    Thank you for your time.

    hi,
    check the same in FTXP,limit the validity period of the old tax to 2007 only.

  • Status codes in Purchase Order Response screen

    Hello,
       I still relatively new to SRM and have a question on how the status codes on the purchase order response screen works.
    Specifically what is the logic / selection criteria for "Variance in Purchase order Response"? My initial analysis is that this displays variance against the Original PO values rather than the current PO values if they have been updated to matched the POR.
    Thanks
    Gary

    Thanks Ravi but I belive that we do not use SUS. Suppliers interface with SRM via a web portal.
    Any suggestions where I can find detailed user / functional documentation on what each of the search parameters mean ?
    Thanks again
    Gary

  • Default tax code in Purchase Order

    hi,
    somehow, is it possible to get default tax code (at "Item overview" under "Invoice"), as soon as enter material group (or by other means) in purchase order?
    thanks

    Dear Yogi,
    Sorry, for posting in to Closed thread.
    I had visited your same thread in to MM-Forum. Apart, whatever, suggestions have been provided, you may give a try to:
    To default the taxcode in the purchase order item, use Condition Type: NAVS, with Access Sequence: 0003
    Path: SPRO -> IMG -> Materials Management -> Purchasing -> Purchasing order processing ->define screen layout at document level
    T. Code: ME21 and Double click. Look for TaxCode. The tax code should be a required entry, and whatever you specify here will be the default value in the Purchase order.
    It is advisable to configure also the info record.
    Path: SPRO -> IMG -> Materials Management -> Purchasing -> Purchasing info record -> Define screen layout.
    When you get here you search for the T. Code: ME12 (Change Purchasing Info Record), and double click here; search for Input TAX indicator.
    You may also seek Advise from MM-Consultants, over this, by referring the whole solution in to your MM-thread.
    Best Regards,
    Amit

  • Tax Code in Purchase order

    Hi Friends,
    While creating purchase order, I am getting below error:
    Tax code X2 does not exist for jurisdiction code CNM9W1N40
    What could be the reason?Can anybody please help me?
    Thanks,
    Bhairav

    It is giving below instructions. I am not able to get...
    Tax code X2 does not exist for jurisdiction code CNM9W1N40
    Message no. FF718
    Diagnosis
    You have entered tax codes and jurisdiction codes in the G/L account items. The amounts of these items are used as the tax base to check the tax amounts you have entered or to determine the taxes. The system has now determined that one or more of the "tax code / jurisdiction code" combinations do not exist in Customizing.
    System response
    Calculation of the taxes or checking of the taxes entered had to be terminated.
    Procedure
    Check the tax codes and the jurisdiction codes in the G/L account items or asset items. If these are correct, inform your system administrator.
    Procedure for System Administration
    Change the tax jurisdictions you specified in Customizing under Financial Accounting -> Financial Accounting Global settings -> Tax on Sales/Purchases -> Basic Settings -> Define Tax Jurisdictions
    Thanks,
    Bhairav

Maybe you are looking for

  • Changes in the Payment program Form for Checks

    SAP Experts, Issue: The Form for printing checks is not printing correctly. When there is an Overflow of Invoices from the first page (> 14) the check is voided on the first page and the invoice data overflows to the next page which is fine, but the

  • Inserting 10 million rows in to a table hangs

    HI through toad iam using a simple for loop to insert 10 million rows into a table by saying for i in 1 ......10000000 insert................. It hangs ........ for lot of time is there a better way to insert the rows in to the table....? i have to t

  • Select option in module pool program

    Hi, I have develop a module pool program. In one of the screen i need select option. so do any one have idea or approach for it. Thanks in advance.

  • IPhoto book to slideshow online?

    I made a book on iPhoto of my safari pictures.  I want to share it online to iTunes or YouTube as a slideshow.  Is that possible?

  • Popup windows flash open then closed while watching videos or visitng websites.

    It seems to happen more often when I am watching a video on Youtube or Hulu. The video is playing normally and all of a sudden what looks like a pop up window opens and immediately closes. Sometimes you can see what looks like a person or an ad, but