Credit card handling using sales order change BAPI

Hi all,
  Currently, I am working on creating a custom BAPI for changing the sales order information. I am having a scenario where I need to handle multiple credit cards during the change of the sales order data. For example, if I have created a sales order  with a credit card A and a bill amount of 100. Now, in the change BAPI, I need to handle the situation like I would be getting two credit cards data out of which I need to Bill against credit card A with 200 and credit card B with 300. I need to see the entries in the sales order processing in the following fashion:
During the creation:
Credit card type    Credit card number    Maximum amount  Limit To
AMEX                   A                             100                        Flag checked
After performing change order:
Credit card type    Credit card number    Maximum amount  Limit To
AMEX                   A                             100                       Flag checked
VISA                    B                              300                       Flag checked
AMEX                   A                             100                       Flag checked
Which implies that I am billing 200 against card A and 300 against card B.
I want to acheive this functionality. Can any one throw some light in order to accomplish my task?
Thanks in advance,
From,
Adithya

i already used same But it's not working
s_order_header_inx-updateflag = 'U'.
Line items
  REFRESH: i_order_item_in, i_order_item_inx.
  LOOP AT t_data INTO wa_data.
    LOOP AT t_data_item INTO wa_data_item WHERE vbeln = wa_data-vbeln. .
BAPISDITM
      i_order_item_in-itm_number = wa_data_item-posnr.
      i_order_item_in-profit_ctr = wa_data_item-profit_ctr.
BAPISDITMX
      i_order_item_inx-itm_number = wa_data_item-posnr.
      i_order_item_inx-updateflag = 'U'.
      i_order_item_inx-profit_ctr = 'X'.
      APPEND: i_order_item_in, i_order_item_inx.
    ENDLOOP.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = wa_data-vbeln
      IMPORTING
        output = wa_data-vbeln.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument     = wa_data-vbeln
        order_header_in   = s_order_header_in
        order_header_inx  = s_order_header_inx
        behave_when_error = 'P'
      TABLES
        return            = it_return
        order_item_in     = i_order_item_in
        order_item_inx    = i_order_item_inx.

Similar Messages

  • Extending sales order change BAPI and updating custom fields

    Hi
    i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table.
    i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX.
    may i know what else i need to do?should i move them anywhere with in the code or does the bapi take those values automatically using EXTENSIONIN structure?
    also can some one send me code to actually check if bapi is changing my values?
    if poss tell me how should i populate values into BAPI.

    After adding field in structures VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX, create pair of name-value pair extensiot structure and value.
    Fill values as follows :
    Data :   ls_parex  TYPE  bapiparex,
                lt_parex  TYPE STANDARD TABLE OF  bapiparex.
    ls_parex-structure = 'BAPE_VBAK'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(XX) = somevalue.  <---- Value for custom field no 1
    ls_parex-valuepart1+XX(XX) = somevalue.  <---- Value for custom field no 2
    APPEND ls_parex TO lt_parex  .
    clear ls_parex.
    ls_parex-structure = 'BAPE_VBAKX'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(1) = 'X'. <--- checkbox mark for custom field no 1
    ls_parex-valuepart1+11(1) = 'X'. <--- checkbox mark for custom field no 2
    APPEND ls_parex TO lt_parex.
    Same pair for VBAKKOZ & VBAKKOZX
    Updating custom fields
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = Sales order number
          order_header_inx = 'U'   <--- U for update
        TABLES
          extensionin      = lt_parex[].
    Edited by: nkarwa on Oct 25, 2010 12:39 PM

  • Sale Order change BAPI - Storage loc not updated

    Hi Everybody,
    Iam using "BAPI_SALESORDER_CHANGE", to change the sale order items.
    First iam calling above bapi with switch B, for new pricing & then second time for material change.
    When i change any material number, it is getting updated correctly.
    But the storage location, even though iam passing in the bapi it is not updated, & is blank - updation flag is also passed.
    When i execute sale order change again it is updated - ie, for any material change for first bapi call, storage loc is not updated - for 2nd bapi call storage loc is updation - for same input in both the cases.
    Is there any way to update the storage loc is first call of sales order change bapi.
    Below is the parameters iam passing in bapi :
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT      = LS_SALESDOCUMENT
          ORDER_HEADER_IN    = LT_HEADER_IN
          ORDER_HEADER_INX   = LT_HEADER_X
        TABLES
          RETURN                            = LT_RETURN
          ORDER_ITEM_IN               = LT_ITEMS
          ORDER_ITEM_INX             = LT_ITEM_X
          ORDER_CFGS_REF          = LT_CFGS_REF
          ORDER_CFGS_INST         =  LT_PARTS
          ORDER_CFGS_VALUE     = LT_VALUES
          ORDER_CFGS_BLOB        = LT_CUBLOB
          ORDER_CFGS_VK            = LT_CUVK
          ORDER_CFGS_REFINST   = LT_CUREF
          SCHEDULE_LINES            = LT_SCHEDULE_L
          SCHEDULE_LINESX         = LT_SCHEDULE_X
          ORDER_TEXT                   = LT_TEXT
          CONDITIONS_IN                = LT_CONDITION_L
          CONDITIONS_INX              = LT_CONDITION_X.
    Any help is appreciated.
    Regards,
    Nagarajan.J

    Hi,
    Storage location is updated only when same sale order bapi is called another time with required details.
    rgs,
    Nagarajan J

  • How to see masked Credit Card number in Sales Order !!

    Hi,
    In our SAP system credit card enceryption is activated. Certain users want to see the credit card number in the sales order change/display screen.We are in SAP ECC 6.0.
    Please let me know how we can achieve this.
    Thanks
    Ambuj

    Dear Ambuj,
    There is no possibility to view the credit card number unmasked in the sales order. You will always get the masked number even if you have C4 authorisation ('C4' action for the V_VBAK_AAT authorisation object). You can view the unmasked credit card number in transaction XD02/XD03.
    If you use BAPISDORDER_GETDETAILEDLIST to view the order then the C4 authorisation will be checked and the unmasked number will be displayed (if the user has this authorisation).
    If you have access to OSS notes then please check 836079 (FAQ: Credit card encryption and master data) and 766703 (FAQ: Credit card encryption in R/3 systems).
    I hope this helps.
    Best regards,
    Ian Kehoe.

  • Calling a Sales Order Change BAPI in a Sales Order Exit

    Functional Requirement:
    While creating a Sales Order with Reference to another Sales Order, on saving the new sales order, change something in the referenced sales order.
    I am trying to achieve the same by doing the following:
    In the standard SAP user exit called during saving the new sales order USEREXIT_SAVE_DOCUMENT I am calling the BAPI BAPI_SALESORDER_CHANGE on the referenced Sales Order.
    However the BAPI is unable to change the other sales order giving an error Enter the document number. I am specifying the Document Number while calling the BAPI, so I know that is not the error.
    I just wish to know whether it is technically possible to call a BAPI to update another Sales Order while we are currently saving one Sales Order.

    Hi Girish,
    If it works correctly when run seperately and you are sure the data passed into the BAPI is exactly the same then it may be something like table locks or similar causing your original problems...
    What about packaging up your working Z program into a custom function module and calling that from within USEREXIT_SAVE_DOCUMENT as a seperate task (IN NEW TASK) and building in a slight delay of say 5 seconds at the start of your code?
    I'll be honest, this isn't an ideal solution but might be sufficient to resolve your issues.  I'd be inclined to see if you could just run your Z program as a background process every 5 minutes or so to capture any changes and perform updates but if this is a no no from your functional people I'm not sure what else to suggest sorry.  I've never personally had to update a document from within the save routine of another document so can't give any advice based on my own experiences sorry.
    Gareth.

  • Getting Error while creating multiple Orders using Sales order Create BAPI

    Hi,
    I am trying to create 2 orders thru the Sales order create BAPI before I commit and save the orders. The Orders are getting created and the BAPI is coming back with success, but it is not setting the system status on the line items of the 1st order. So when I try to cancel the line items on the first order I get the error 'No status object is available for SDI 4924/10' . I would really appreciate if anyone has encountered such error before and could help me out with the reason for this error and the possible solution.
    Thanks in advance,
    David.

    Hi,
    Check the following link:
    http://www.sap-img.com/bapi.htm
    Regards,
    Bhaskar

  • Sales Order Change BAPI - Reason for Rejection

    Hi,
    I want to update reason for rejection field for a particular sales order at item level. When I am executing the BAPI "BAPI_SALESORDER_CHANGE", I am getting the error "Field header_inx-updateflag is not an input field". I did not check this field as I'm not making any change in the header part.
    Please help me in resolving this issue. Let me know if I have to provide any other information.
    regards,
    ravikiran.

    Found BAPI myself...... BAPI_SALESORDER_CHANGE

  • Customer- credit Card Issue on Sales Order

    Hi Experts,
    There is an issue,where an incorrect Credit Card details are showing up during an order creation for a Customer.
    In XD02, the payment card details shows it as Master Card. But while creating order(VA01),it showing VISA card. Can anyone explain what could be the issue?
    It should appear as Master card in VA01 too.
    Thanks,
    Arhy

    Hi,
    Check the Card details of the  Payer and not Sold to Party.
    Regards,
    Sharan

  • Using Planned order Change BAPI with out changing date

    Hi
    I have a planned order with start date in future.
    With in a program, I want to call the planned order using the FM BAPI_PLANNEDORDER_CHANGE to re-explode the order BOM.
    I find that only if I change the order start date to system/current date, the planned order BOM gets updated/re-exploded. Else there is no change in the order BOM.
    My requirement is to re-explode the BOM with out changing the order dates. In the function module I am maintaining "X' against BOM_EXP_FIX_IND.
    But when I do it manually using MD12 and explode BOM with out changing the future start date, the order BOM gets updated.
    Please help on this. Or is there any other FM/BAPI for this purpose.

    Dear Pradeep,
    you could try to set DET_SCHEDULE = X with out
    FIRMING_IND  --> No
    BOM_EXP_FIX_IND   --> No
    Let me Know if it modification setting have solved your problem and i have useful for you,
    Daniele

  • Sales order change BAPI not updating items Profit center

    Dear ,
    I am facing the problem in using the BAPI for Item 's profit centre  in blank space.
    I write down the below code <but it's not at all updating the profite centre .
    please ccorrect the code if any required'
    TYPES: BEGIN OF file_data ,
           vbeln TYPE vbap-vbeln, " order numner
           posnr TYPE vbap-posnr, " orderitem
           profit_ctr TYPE vbap-prctr, " [profite centre
          END OF file_data.
    DATA: t_data TYPE STANDARD TABLE OF file_data .
    DATA : wa_data LIKE LINE OF t_data.
    DATA: t_data_item TYPE STANDARD TABLE OF file_data .
    DATA : wa_data_item LIKE LINE OF   t_data_item.
    **DATA: t_data_item TYPE file_data OCCURS 0.
    *DATA: return TYPE STANDARD TABLE OF bapiret2.
    *DATA: wa_return LIKE LINE OF return.
    DATA: wait LIKE bapita-wait VALUE 'X'.
    DATA: s_order_header_in LIKE bapisdh1.
    DATA: s_order_header_inx LIKE bapisdh1x.
    DATA: BEGIN OF i_order_item_in OCCURS 0.
            INCLUDE STRUCTURE bapisditm.
    DATA: END OF i_order_item_in.
    DATA: BEGIN OF i_order_item_inx OCCURS 0.
            INCLUDE STRUCTURE bapisditmx.
    DATA: END OF i_order_item_inx.
    DATA: BEGIN OF it_return OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF it_return.
    ***********************selection
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS : file LIKE rlgrap-filename OBLIGATORY.
    "ctu_mode  TYPE ctu_mode  DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    *********assign file
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
      CLEAR file.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = file
        EXCEPTIONS
          OTHERS    = 1.
      DATA:  it_text TYPE truxs_t_text_data .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator    = 'X'
          i_line_header        = 'X'
          i_tab_raw_data       = it_text
          i_filename           = file
        TABLES
          i_tab_converted_data = t_data[] " Your internal table of structure of Excel sheet
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      t_data_item[] =  t_data[].
      DELETE ADJACENT DUPLICATES FROM t_data COMPARING vbeln.
    Header update indicator
      s_order_header_inx-updateflag = 'U'.
    Line items
      REFRESH: i_order_item_in, i_order_item_inx.
      LOOP AT t_data INTO wa_data.
        LOOP AT t_data_item INTO wa_data_item WHERE vbeln = wa_data-vbeln. .
          i_order_item_in-itm_number = wa_data_item-posnr.
          i_order_item_in-profit_ctr = wa_data_item-profit_ctr.
          i_order_item_inx-itm_number = wa_data_item-posnr.
          i_order_item_inx-updateflag = 'U'.
          i_order_item_inx-profit_ctr = 'X'.
          APPEND: i_order_item_in, i_order_item_inx.
        ENDLOOP.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_data-vbeln
          IMPORTING
            output = wa_data-vbeln.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument     = wa_data-vbeln
            order_header_in   = s_order_header_in
            order_header_inx  = s_order_header_inx
            behave_when_error = 'P'
          TABLES
            return            = it_return
            order_item_in     = i_order_item_in
            order_item_inx    = i_order_item_inx.

    i already used same But it's not working
    s_order_header_inx-updateflag = 'U'.
    Line items
      REFRESH: i_order_item_in, i_order_item_inx.
      LOOP AT t_data INTO wa_data.
        LOOP AT t_data_item INTO wa_data_item WHERE vbeln = wa_data-vbeln. .
    BAPISDITM
          i_order_item_in-itm_number = wa_data_item-posnr.
          i_order_item_in-profit_ctr = wa_data_item-profit_ctr.
    BAPISDITMX
          i_order_item_inx-itm_number = wa_data_item-posnr.
          i_order_item_inx-updateflag = 'U'.
          i_order_item_inx-profit_ctr = 'X'.
          APPEND: i_order_item_in, i_order_item_inx.
        ENDLOOP.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_data-vbeln
          IMPORTING
            output = wa_data-vbeln.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument     = wa_data-vbeln
            order_header_in   = s_order_header_in
            order_header_inx  = s_order_header_inx
            behave_when_error = 'P'
          TABLES
            return            = it_return
            order_item_in     = i_order_item_in
            order_item_inx    = i_order_item_inx.

  • Sales Order Change BAPI Extension for Customer Fields

    Hello!
    I am working on customer field enhancement for BAPI_salesorder_change. The extensionin parameter has more than 1000 characters (fields in the structure BAPE_VBAP) and hence, the two fields that I added to VBAP (using append structure) are not getting the data.
    I have followed all the steps that was given in the documentation to fill extensionin like adding the fields to VBAPKOZ and BAPE_VBAP. This is the logic I have used to fill EXTENSIONIN:
    BAPE_VBAP-VBELN = P_order.
    BAPE_VBAP-POSNR = i_vbap-posnr.
    BAPE_VBAP-ZZSTART_DT = sy-datum.
    BAPE_VBAP-ZZdnload_DT = sy-datum.
    T_EXTEN-STRUCTURE = 'BAPE_VBAP'.
    *T_EXTEN+30 = BAPE_VBAP.
    T_EXTEN-valuepart1 = bape_vbap.
    T_EXTEN-valuepart2 = bape_vbap+240(240).
    T_EXTEN-valuepart3 = bape_vbap+480(240).
    T_EXTEN-valuepart4 = bape_vbap+720(240).
    APPEND T_EXTEN.
    Clear t_exten.
    BAPE_VBAPX-VBELN = P_order.
    BAPE_VBAPX-POSNR = i_vbap-posnr.
    BAPE_VBAPX-ZZSTART_DTX = 'X'.
    BAPE_VBAPX-ZZdnload_DTX = 'X'.
    T_EXTEN-STRUCTURE = 'BAPE_VBAPX'.
    T_EXTEN-valuepart1 = bape_vbapx.
    APPEND T_EXTEN.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = p_order
    order_header_inx = ORDER_HEADERX
    tables
    return = T_RETURN
    *ORDER_ITEM_IN = T_LINE
    *ORDER_ITEM_INX = T_LINEX
    EXTENSIONIN = T_EXTEN.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    I guess there is 960 character limitation for BAPIPAREX structure but I would like to know if there is a way to work around it.
    Thanks to all for your time.

    Found BAPI myself...... BAPI_SALESORDER_CHANGE

  • I have a preorder and I can't find the credit card I used to buy it in the first place. Is there any way I can switch the payment to a new card and get my cd?

    I preordered a CD and I can't find the credit card I used to order it so I can't confirm the billing and recieve my CD Is there any way I can switch the payment to a new card and get my cd?

    Welcome to Apple Communities
    PowerPC applications are unsupported in newer versions. You can upgrade Photoshop or you can install Snow Leopard in a partition.
    1. Open Disk Utility (Applications > Utilities) and select your drive
    2. Go to Partitions tab, press + button, create a new partition and press Apply
    3. Insert the Snow Leopard install DVD and reboot pressing C key
    4. Install it in the new partition
    5. If you want to change boot, go to System Preferences > Startup Disk and select 10.7

  • Updating a child of a BOM material using bapi sales order change

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

  • BAPI_SALESORDER_SIMULATE can be used in case of Sales Order Change?

    Hi All,
    I'm using FM 'BAPI_SALESORDER_CHANGE' to update sales order.
    It's working fine even multiful item (delete, add, changing item).
    But I need to give simulated information to SAP portal before changing Sales order.
    This 'BAPI_SALESORDER_SIMULATE' FM looks like for creating new Sales Order.
    Is there any other simulation BAPI FM for Sales order change?
    Thanks.

    Hi,
    You can use
    BAPI_ORDER_CHANGE_STATUS_GET   Change status for order                                                  
    BAPI_SALESORDER_CHANGE         Sales Order: Change Sales Order                                          
    Thanks
    Sarada

  • Credit Check during Sales Order Change (VA02)

    Hi,
    We have implemented a credit management system, where the sales order will not get saved if the credit limit is exceeded. Now this check is working fine during sales order creation. But in VA02 during sales order change, the system is giving an information message that the credit limit is exceeded, but is allowing to save the order, which is not desirable. Could you all please help me in finding a solution to this problem..
    Thanks & Regards,
    Ritam Bera

    Hi
    Kindly check that you are using simple credit check or automatic credit check(Statis or Dynamaic) below settings
    If Automatic credit check then  go to  OVA8 -automatic credit control area with combination of Credit control area/Risk category /credit group,Check in the reaction field  you have mentioned the error or warning (B or A) .
    Prerequisites for credit management to work in Sales and Distribution:
    1.Assign credit control area to company code
    2.Maintain the credit limit in FD32 with details of risk category and the credit limit value
    3.Do the settings in OVA8 -automatic credit control area with combination of Credit control area/Risk category /credit group,Check in the reaction field  you have mentioned the error or warning (B or A) .
    4.Assign the credit groups to the sales and delivery document types.
    5.Maintain the Subtotal 'A' in the pricing procedure against which value the sytem should check the credit limit.
    If you have any further clarifications on above let me know
    Regards
    Damu

Maybe you are looking for

  • Jsf passing parameter between jsp's

    Hi I have my main.jsp and another screen which i call object.jsp the object.jsp can present an object in multiple ways : add, edit, view i have 3 buttons in my main.jsp add, edit, view. I want to pass a parameter from main.jsp to object.jsp such that

  • Unable to manually change the amount for condition type PB00

    Hi Gurus, My client is using ECC5.0. Here when I try to change the amount for condition type PB00 using transaction ME22N, I am not able to change the value. I donu2019t get any error, but as soon as I change the value and press Enter the system repl

  • Deadlock with CREATE GLOBAL TEMPORARY TABLE

    I got this error ORA-00604: error occurred at recursive SQL level 1 ORA-00060: deadlock detected while waiting for resource while trying to create global temporary table. Table creation command: CREATE GLOBAL TEMPORARY TABLE ITUSER.T_0091FBDG ("GOD"

  • How to package multiple simulations?

    Hi I'm starting an elearning project that will have about 50 simulations of a software program.  I've discovered the Aggregator and have a basic idea of how it works, but still not sure the best solution. I would like some kind of page(s) for text an

  • File convert trouble

    Hi, so i have a sony hd cam and FCE and have been using Clipwrap to convert my mt2s files from my camera to AIC format. This works easy and well just dragging and dropping, it then saves them to my external hard drive. But i have found that i've impo