Quantity field in bapi  BAPI_PO_CREATE

Hi ,
What is the filed name to pass the QUANTITY in the lineitems table*(PO_ITEMS) for the Bapi BAPI_PO_CREATE
FIleld name DISP_QUAN is not accepting the Quantity and showing the error as  ENTER QUANTITY
when BAPI is executed.
Regards
Ajay

Hai.
check this.
REPORT zpo_bapi_purchord_tej.
DATA DECLARATIONS *
TYPE-POOLS slis.
TYPES: BEGIN OF ty_table,
v_legacy(8),
vendor TYPE bapimepoheader-vendor,
purch_org TYPE bapimepoheader-purch_org,
pur_group TYPE bapimepoheader-pur_group,
material TYPE bapimepoitem-material,
quantity(13),
delivery_date TYPE bapimeposchedule-delivery_date,
net_price(23),
plant TYPE bapimepoitem-plant,
END OF ty_table.
TYPES: BEGIN OF ty_alv,
v_legs(8),
success(10),
v_legf(8),
END OF ty_alv.
TYPES: BEGIN OF ty_alv1,
v_legf1(8),
v_msg(500),
END OF ty_alv1.
*-----Work area declarations.
DATA: x_table TYPE ty_table,
x_header TYPE bapimepoheader,
x_headerx TYPE bapimepoheaderx,
x_item TYPE bapimepoitem,
x_itemx TYPE bapimepoitemx,
x_sched TYPE bapimeposchedule,
x_schedx TYPE bapimeposchedulx,
x_commatable(255),
x_alv TYPE ty_alv,
x_alv1 TYPE ty_alv1,
x_alv2 TYPE ty_alv1.
*-----Internal table declarations.
DATA: it_table TYPE TABLE OF ty_table,
it_commatable LIKE TABLE OF x_commatable,
it_item TYPE TABLE OF bapimepoitem,
it_itemx TYPE TABLE OF bapimepoitemx,
it_sched TYPE TABLE OF bapimeposchedule,
it_schedx TYPE TABLE OF bapimeposchedulx,
it_alv TYPE TABLE OF ty_alv,
it_alv1 TYPE TABLE OF ty_alv1,
it_alv2 TYPE TABLE OF ty_alv1.
DATA: po_number TYPE bapimepoheader-po_number,
x_return TYPE bapiret2,
it_return TYPE TABLE OF bapiret2,
v_file TYPE string,
v_temp(8),
v_succsount TYPE i VALUE 0,
v_failcount TYPE i VALUE 0,
v_total TYPE i.
DATA: v_temp1(5) TYPE n VALUE 0.
DATA: x_event TYPE slis_t_event,
x_fieldcat TYPE slis_t_fieldcat_alv,
x_list_header TYPE slis_t_listheader,
x_event1 LIKE LINE OF x_event,
x_layout1 TYPE slis_layout_alv,
x_variant1 TYPE disvariant,
x_repid2 LIKE sy-repid.
DATA : it_fieldcat TYPE TABLE OF slis_t_fieldcat_alv.
SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK v_b1 WITH FRAME.
*-----To fetch the flat file.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK v_b1.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN.
IF p_file IS INITIAL.
MESSAGE text-001 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*-----To use F4 help to find file path.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
v_file = p_file.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM gui_upload.
LOOP AT it_table INTO x_table.
PERFORM header_details.
v_temp = x_table-v_legacy.
LOOP AT it_table INTO x_table WHERE v_legacy = v_temp.
PERFORM lineitem.
PERFORM schedule.
ENDLOOP.
DELETE it_table WHERE v_legacy = v_temp.
PERFORM bapicall.
MOVE po_number TO x_alv-success.
APPEND x_alv TO it_alv.
CLEAR x_alv.
*-----To clear the item details in internal table after the operation for a header.
REFRESH: it_item,
it_itemx,
it_sched,
it_schedx.
CLEAR: v_temp1.
ENDLOOP.
v_total = v_succsount + v_failcount.
PERFORM display_alv.
FORM GUI_UPLOAD *
FORM gui_upload .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
TABLES
data_tab = it_commatable
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc = 0.
*-----To fetch the comma seperated flat file into an internal table.
LOOP AT it_commatable INTO x_commatable.
IF x_commatable IS NOT INITIAL.
SPLIT x_commatable AT ',' INTO
x_table-v_legacy
x_table-vendor
x_table-purch_org
x_table-pur_group
x_table-material
x_table-quantity
x_table-delivery_date
x_table-net_price
x_table-plant.
APPEND x_table TO it_table.
ENDIF.
CLEAR x_table.
ENDLOOP.
ENDIF.
ENDFORM. " gui_upload
FORM HEADER_DETAILS *
FORM header_details .
MOVE 'NB' TO x_header-doc_type.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_table-vendor
IMPORTING
output = x_table-vendor
MOVE x_table-vendor TO x_header-vendor.
MOVE x_table-purch_org TO x_header-purch_org.
MOVE x_table-pur_group TO x_header-pur_group.
x_headerx-doc_type = 'X'.
x_headerx-vendor = 'X'.
x_headerx-purch_org = 'X'.
x_headerx-pur_group = 'X'.
ENDFORM. " header_details
FORM LINEITEM *
FORM lineitem .
v_temp1 = v_temp1 + 10.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_temp1
IMPORTING
output = v_temp1.
MOVE v_temp1 TO x_item-po_item.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_table-material
IMPORTING
output = x_table-material.
MOVE x_table-material TO x_item-material.
MOVE x_table-quantity TO x_item-quantity.
MOVE x_table-net_price TO x_item-net_price.
MOVE x_table-plant TO x_item-plant.
x_itemx-po_item = v_temp1.
x_itemx-material = 'X'.
x_itemx-quantity = 'X'.
x_itemx-net_price = 'X'.
x_itemx-plant = 'X'.
APPEND x_item TO it_item.
APPEND x_itemx TO it_itemx.
CLEAR: x_item, x_itemx.
ENDFORM. " lineitem1
FORM SCHEDULE *
FORM schedule .
MOVE x_table-delivery_date TO x_sched-delivery_date.
MOVE v_temp1 TO x_sched-po_item.
x_schedx-delivery_date = 'X'.
x_schedx-po_item = v_temp1.
APPEND x_sched TO it_sched.
APPEND x_schedx TO it_schedx.
CLEAR: x_sched, x_schedx.
ENDFORM. " schedule
FORM BAPICALL *
FORM bapicall .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = x_header
poheaderx = x_headerx
IMPORTING
exppurchaseorder = po_number
TABLES
return = it_return
poitem = it_item
poitemx = it_itemx
poschedule = it_sched
poschedulex = it_schedx.
IF po_number IS NOT INITIAL.
v_succsount = v_succsount + 1.
MOVE x_table-v_legacy TO x_alv-v_legs.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
v_failcount = v_failcount + 1.
MOVE x_table-v_legacy TO x_alv-v_legf.
MOVE x_table-v_legacy TO x_alv1-v_legf1.
LOOP AT it_return INTO x_return.
IF x_alv1-v_msg IS INITIAL.
MOVE x_return-message TO x_alv1-v_msg.
ELSE.
CONCATENATE x_alv1-v_msg x_return-message INTO x_alv1-v_msg SEPARATED BY space.
ENDIF.
ENDLOOP.
APPEND x_alv1 TO it_alv1.
CLEAR x_alv1.
ENDIF.
ENDFORM. " bapicall
FORM DISPLAY_ALV *
FORM display_alv .
PERFORM x_list_header.
PERFORM build_fieldcat CHANGING x_fieldcat.
x_repid2 = sy-repid.
x_event1-name = 'TOP_OF_PAGE'.
x_event1-form = 'TOP_OF_PAGE'.
APPEND x_event1 TO x_event.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = x_repid2
is_layout = x_layout1
it_fieldcat = x_fieldcat
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_save = 'A'
is_variant = x_variant1
it_events = x_event
TABLES
t_outtab = it_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " display_master_data
FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm selfield
TYPE slis_selfield.
READ TABLE it_alv INTO x_alv INDEX selfield-tabindex.
CLEAR : x_alv2,it_alv2[].
LOOP AT it_alv1 INTO x_alv1 WHERE v_legf1 = x_alv-v_legf.
x_alv2 = x_alv1.
APPEND x_alv2 TO it_alv2 .
ENDLOOP.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv.
DATA : x3_fieldcat LIKE LINE OF it_fieldcat.
CLEAR : x3_fieldcat,it_fieldcat[].
CLEAR x3_fieldcat.
x3_fieldcat-col_pos = '1'.
x3_fieldcat-fieldname = 'V_LEGF1'.
x3_fieldcat-reptext_ddic = text-111.
x3_fieldcat-ref_tabname = 'IT_ALV2'.
APPEND x3_fieldcat TO it_fieldcat.
CLEAR x3_fieldcat.
CLEAR x3_fieldcat.
x3_fieldcat-col_pos = '1'.
x3_fieldcat-fieldname = 'V_MSG'.
x3_fieldcat-reptext_ddic = text-112.
x3_fieldcat-ref_tabname = 'IT_ALV2'.
APPEND x3_fieldcat TO it_fieldcat.
CLEAR x3_fieldcat.
x_layout1-colwidth_optimize = 'X'.
x_layout1-zebra = 'X'.
IF it_alv2[] IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = x_repid2
is_layout = x_layout1
it_fieldcat = it_fieldcat
i_save = 'A'
i_callback_top_of_page = 'TOP'
is_variant = x_variant1
it_events = x_event
TABLES
t_outtab = it_alv2
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDIF.
ENDFORM.
FORM USER_COMMAND *
FORM top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = 'Commentry'.
ENDFORM.
FORM BUILD_FIELDCAT *
FORM build_fieldcat CHANGING et_fieldcat TYPE slis_t_fieldcat_alv.
DATA: x1_fieldcat TYPE slis_fieldcat_alv.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '1'.
x1_fieldcat-fieldname = 'V_LEGS'.
x1_fieldcat-reptext_ddic = text-108.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '2'.
x1_fieldcat-fieldname = 'SUCCESS'.
x1_fieldcat-key = 'X'.
x1_fieldcat-reptext_ddic = text-109.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '3'.
x1_fieldcat-fieldname = 'V_LEGF'.
x1_fieldcat-key = 'X'.
x1_fieldcat-reptext_ddic = text-110.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
ENDFORM. " build_fieldcat
FORM BUILD_LIST_HEADER *
FORM x_list_header.
DATA: x_list_header1 TYPE slis_listheader.
*-----List Header: type H
CLEAR x_list_header1 .
x_list_header1-typ = 'H'.
x_list_header1-info = text-105.
APPEND x_list_header1 TO x_list_header.
*-----List Key: type S
x_list_header1-typ = 'S'.
x_list_header1-key = text-106.
x_list_header1-info = v_total.
APPEND x_list_header1 TO x_list_header.
*-----List Key: Type S
CLEAR x_list_header1 .
x_list_header1-typ = 'S'.
x_list_header1-key = text-107.
x_list_header1-info = v_succsount.
APPEND x_list_header1 TO x_list_header.
ENDFORM. " build_list_header
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = x_list_header.
ENDFORM. " TOP_OF_PAGE
regards.
sowjanya.b

Similar Messages

  • Populating Quantity field in BAPI : "BAPI_OPPORTUNITY_CREATEMULTI"

    I want to populate quantity field for an Item while creating Opportunity using BAPI_OPPORTUNITY_CREATEMULTI.
    along with other data, I am populating BAPI internal table required for quantity as below, opportunity is being created with item. But quantity field is blank. Can anyone advise what I have been doing wrong or what’s right way of populating this table parameter.
    Appreciate help on this.
        s_scheduleline-item_handle = ‘0000000002’.
        s_scheduleline-handle = ‘0000000001’.
        s_scheduleline-quantity = s_valid-est_qty.  " Quantity
        APPEND s_scheduleline TO it_scheduleline.
        s_input-ref_handle = ‘0000000002’
        s_input-ref_kind    = 'B'.
        s_input-objectname  = 'SCHEDLIN'.
        s_input-fieldname  = 'QUANTITY'.
        APPEND s_input TO it_input.
        CALL FUNCTION 'BAPI_OPPORTUNITY_CREATEMULTI'
          TABLES
            header        = it_header
            opportunity   = it_opp
            partner       = it_partner
            appointment   = it_appointment
            status        = it_status
            customer_head = it_cust_h
            text          = it_text
            item          = it_item
            product       = it_product
            scheduleline  = it_scheduleline
            pricing_item  = it_price_i
            input_fields  = it_input
            saved_process = it_saved
            return        = it_return.

    Be sure to reset logical_key field from input_fields structure after inserting partner data.
        ls_fields-objectname = 'PARTNER'.
        ls_fields-logical_key = '0000'.
        ls_fields-fieldname   = gc_fieldname-partner_no.
        APPEND ls_fields TO lt_fields.
        ls_fields-logical_key = ''.
    Edited by: Dalibor Riger on Nov 29, 2011 5:09 PM

  • Passing custom fields to BAPI

    Hi All,
    How can i handle the Quantity field using BAPIPAREX?
    EX.
    I have added the following custom fields to the standard table EKKO.   
        zf_base        (Price per ton, CURRENCY)
        zreq_tons      (Tons Required,QUANTITY)
        zpo_issue_date (PO Issue date,Date)
    Here I am using the bapi 'BAPI_PO_CREATE1' to create Purchase Order. How can i pass the above fields to BAPI.

    U dont have to create a Z verion. u can use extensionIN parameter. take a look at the bapi funtion module documentation. here is the hint,
    <b>Customer's Own Fields (Import Parameters)</b>
    This table allows you to add to the import parameters of the BAPI without modifying it.
    The customer enhancement SAPL2012 allows you to add to or modify the PurchaseOrder.Change and PurchaseOrder.CreateFromData1BAPIs by:
    •     Adapting existing SAP database tables
    o     Adding customer-specific fields to SAP tables
    o     Including existing database fields
    •     Including additional customer-specific database tables
    The following BAPI Table Extensions are available:
    •     BAPI_TE_MEPOHEADER
    •     BAPI_TE_MEPOHEADERX
    •     BAPI_TE_MEPOITEM
    •     BAPI_TE_MEPOITEMX
    •     BAPI_TE_MEPOACCOUNTING
    •     BAPI_TE_MEPOACCOUNTINGX

  • Field Our_ref in BAPI_PO_CREATE

    Hello,
    I would like to fill the field our reference in the purchase order at the same time I create it. The fuba Bapi_po_create work well in creating, but the field is not filled.
    Maybe I need to fill some more fields, but I don´t know which one. Anyone who knows, how I can fill this field.
    In table it is EKKO-UNSEZ.
    Coding
    DATA: x_po_header TYPE bapiekkoc,
          x_po_header_add type BAPIEKKOA.
       x_po_header_add-OUR_REF     = 'TEST'.
        CALL FUNCTION 'BAPI_PO_CREATE'
             EXPORTING
                  po_header         = x_po_header
                 PO_HEADER_ADD_DATA = x_po_header_add
             IMPORTING
                  purchaseorder     = x_po_number
             TABLES
                  po_items          = x_po_items
                  po_item_schedules = x_po_items_schedules
                  return            = x_bapireturn.
    Thanks Nicole
    Edited by: Nicole Lorenz on Feb 1, 2010 9:50 AM

    You cannot fill the "Our reference" field (EKKO-UNSEZ) using BAPI ,  BAPI_PO_CREATE
    chk this link
    /people/arminda.jack/blog/2009/08/03/do-you-know-what-you-can-or-canacutet-do-with-the-bapiacutes-for-purchase-orders

  • Problem in bapi   BAPI_PO_CREATE

    Hi,
    I am using Bapi BAPI_PO_CREATE To upload data in ME21.
    Please send me the Sample code if possible along with the Data.
    Regards
    AJay

    Hi,
    *& Report  ZDS_BAPI_PO
    REPORT  ZDS_BAPI_PO.
    DATA: PO_NUM TYPE BAPIMEPOHEADER-PO_NUMBER.
    DATA :WA_HEADER TYPE BAPIMEPOHEADER,
          WA_HEADERX TYPE BAPIMEPOHEADERX.
    DATA: IT_ITEM TYPE TABLE OF BAPIMEPOITEM,
          IT_ITEMX TYPE TABLE OF BAPIMEPOITEMX,
          WA_ITEM TYPE  BAPIMEPOITEM,
          WA_ITEMX TYPE BAPIMEPOITEMX,
          IT_RETURN TYPE TABLE OF BAPIRET2,
          WA_RETURN TYPE BAPIRET2.
    WA_HEADER-COMP_CODE = '1000 '.
    WA_HEADER-DOC_TYPE = 'NB'.
    WA_HEADER-ITEM_INTVL = '00001'.
    WA_HEADER-VENDOR = '0000001000' .
    WA_HEADER-PMNTTRMS = '0001' .
    WA_HEADER-PURCH_ORG = '1000' .
    WA_HEADER-PUR_GROUP = '001' .
    WA_HEADER-CURRENCY = 'EUR '.
    WA_HEADERX-COMP_CODE = 'X'.
    WA_HEADERX-DOC_TYPE = 'X'.
    WA_HEADERX-ITEM_INTVL = 'X'.
    WA_HEADERX-VENDOR = 'X' .
    WA_HEADERX-PMNTTRMS = 'X' .
    WA_HEADERX-PURCH_ORG = 'X' .
    WA_HEADERX-PUR_GROUP = 'X' .
    WA_ITEM-PO_ITEM = '00001' .
    WA_ITEM-MATERIAL = '100-100'.
    WA_ITEM-PLANT = '1000'.
    WA_ITEM-STGE_LOC = '0001'.
    WA_ITEM-QUANTITY = '15.000'.
    WA_ITEM-TAX_CODE = 'V0'.
    WA_ITEM-ITEM_CAT = '0'.
    *WA_ITEM-ACCTASSCAT = 'K'.
    APPEND WA_ITEM TO IT_ITEM.
    WA_ITEMX-PO_ITEM = '00001' .
    WA_ITEMX-MATERIAL = 'X'.
    WA_ITEMX-PLANT = 'X'.
    WA_ITEMX-STGE_LOC = 'X'.
    WA_ITEMX-QUANTITY = 'X'.
    WA_ITEMX-TAX_CODE = 'X'.
    WA_ITEMX-ITEM_CAT = 'X'.
    WA_ITEMX-ACCTASSCAT = 'X'.
    APPEND WA_ITEMX TO IT_ITEMX.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER                     = WA_HEADER
        POHEADERX                    = WA_HEADERX
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    IMPORTING
        EXPPURCHASEORDER             = PO_NUM
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
    TABLES
        RETURN                       = IT_RETURN
        POITEM                       = IT_ITEM
        POITEMX                      = IT_ITEMX
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    IF PO_NUM IS NOT INITIAL.
      WRITE:/ 'Po is generated :::::::-',PO_NUM.
    ELSE.
    LOOP AT IT_RETURN INTO WA_RETURN.
      write: / WA_RETURN-MESSAGE.
    ENDLOOP.
    endif.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    * IMPORTING
    *   RETURN        =
    Regards,
    Dhruv Shah

  • Reg: Quantity field taking as decimal values

    Dear Experts
    In the Bapi BAPI_SALESORDER_SIMULATE the structure BAPIITEMIN contains a field Req_qty that has the data element WMENGC which is taking the input with 3 decimal points even though the domain doesnt contains any decimals, because of this im facing the problem while giving the input.
    Is there any functional requirement to avoid that quantity field taking those 3 decimals
    eg: Original Value: 1000
          Input Value(Converted Value)    : 1.000
    Kindly suggest me a solution to sort out the issue.
    Regards
    Arun.P

    well i suspect that this bapi also has a currency field, which you should fill.
    If he knows the currency he should be able to find out how much decimals there are customized for this currency, and then probably he will do it right.
    oh lol you are talking of quantities and not values... sorry forget about my comment...
    Edited by: Florian Kemmer on Jul 22, 2010 2:37 PM

  • ALV Display for Quantity Field

    Hi All,
    I am working on ALV classes.
    I have a quantity field which needs to be displayed without decimals.
    When I declare the data type as type p decimals 0,It is displayed correctly but when I change the field with a value using the method handle_data_changed it gives a value multiplied by 10 always. i.e., when the new value is 5 it gives the value as 50.
    I tried referencing the Unit value but it doesn't work.
    Any views on suppressing the decimal values without getting the value multiplied by 10 is highly appreciated.
    Thank you in advance.
    Regards,
    K.S.

    Hello Kandasamy,
                                 Change the reference field that points to the ALV display field to a non decimal field and then use the Integer variable assignment for  removing the decimals  during teh BAPi or database fetch.
    Hope this answers your question.
    Thanks,
    Greetson

  • Order qty field in bapi and exit

    Hi All,
    Pls resolve my issue......
    I am creating the sales order through 'VA01' t-code.Now based on some conditions I will create a new sales order through BAPI_SALESDOCU_CREATEFROMDATA1 in t-code. I could not found the order quantity field in tables of BAPI thus I am not able to update the order quatity(kwmeng in vbap) for new sales order. Somebody suggested me that I need to update the schedule line item req_qty(its not working).
    *Second Issues:*++
    I am writing the code in SAVE DOCUMENT user exit , this is going into infinite loop. Can anybody suggest me the correct EXIT too.
    Points will be given
    Thanks in advance.

    Hi Friend,
    For the first point:
    Pass quantity in TARGET_QTY of ITEM parameter
    and REQ_QTY of SCHEDULE line parameter of the specified BAPI.
    It will solve ur problem.
    Please clarify little bit on second point.
    Regards
    Krishnendu

  • Passing quantity field into RF Module

    Hi,
        From java application we are passing quantity field (parameters) to bapi goods mvt create . we have applied all right justified , mulitiplying options but unable to post a document. they are using string datatype & we r using the quant ..we have tried with all options with string datatype it is accepting at our end but from java side when they are passing Func. module is not accepting...any clue on it..any fm
    Thanks & Regards
    Gaurav Saxena

    Yes U r right but I had made it string datatype and then right alligned and then again pass it to quantity field it is accepting at our end but failing while java application execution. it is giving the error " Maintain serial number for total quantity " that means it is taking some more quantity instead of 1 ( while  passing i serial no.) something like 10,100.... so any suggestion..

  • Quantity fields not getting displayed in the second total row

    Hi,
    As per the requirement I have to display 2 total rows for an ALV report using CL_GUI_ALV_GRID. I am able to get the first total row properly using method get_subtotal(). However for the next total row only the character fields are getting displayed and the quantity fields are coming blank.
    The second total row will have different values based on a formula.
    Please help me out in resolving the issue.
    Thanks,
    Abhishek

    You can provide first row as the SUBTOTAL and next row as the TOTAL.
    Get one extra column on which you can do the SUBTOTAL.
    Regards,
    Naimesh Patel

  • How can we remove the following zeros from quantity field ?

    Hi All.
    how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
    eg:getting output zqty = 2.000
    but i need           zqty = 2.
    help me to reslove this issue.
    Regards.
    jay

    Hi,
      While populating the field catlog do the following thing to   avoid zeros.
      wa_fieldcat-tabname = 'I_OUTPUT'.    " Curr
      wa_fieldcat-fieldname = 'FWAER'.
      wa_fieldcat-seltext_l = text-023.
      wa_fieldcat-no_zero = 'X'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR  wa_fieldcat.
    Thanks,
    Khushbu.

  • Make quantity field of Free goods as non-editable.

    Hie!
    I have free goods scheme of 9 + 1 .If quantity of main material is 10 then it will split into 9 + 1 where 1 is free of cost.
    While making the sales order the free goods quantity field is editable. So the users are able to change the free goods quantity. I want to make this field as non-editable.
    Please suggest how to do this.
    Thankyou.

    Hi Pallavi
    If you change the manual qty which is automatically determined by the system then there will be a message thrown by the system
    Suppse in your case if 9+1 you change the qty manually to 2 from 1 there is a message V1 no 737 thrown by the system
    You need to change the message class thro ABAP development only not possible thro customization
    Not only this in delivery also it is possible to change the free qty and this also has to be controlled by the ABAPer only
    Regards
    Raja

  • ALV QUANTITY field Geting converted into decimals ?

    Hi All ,
    I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
    Best Regards,
    Sreeram

    Hi Sreeram,
    I am not gettin this issue. See below code :
    If you are gettiing the same issue with the below code then it has something to do with your user settings.
    Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
    Set it to 1,234,567.89 and save. Now try the program again.
    REPORT z_test.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF ty_ekpo,
              ebeln TYPE ebeln,
              ebelp TYPE ebelp,
              ktmng TYPE ktmng,
              menge TYPE bstmg,
            END OF ty_ekpo.
    DATA: it_ekpo TYPE TABLE OF ty_ekpo,
          it_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT ebeln ebelp ktmng menge
      FROM ekpo
      INTO TABLE it_ekpo
      UP TO 20 ROWS.
    PERFORM add_fieldcat USING 'EBELN'.
    PERFORM add_fieldcat USING 'EBELP'.
    PERFORM add_fieldcat USING 'KTMNG'.
    PERFORM add_fieldcat USING 'MENGE'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = sy-repid
       it_fieldcat                       = it_fieldcat
      TABLES
        t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    FORM add_fieldcat  USING  p_fieldname TYPE slis_fieldcat_alv-fieldname.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-tabname = 'IT_EKPO'.
      wa_fieldcat-ref_fieldname = p_fieldname.
      wa_fieldcat-ref_tabname = 'EKPO'.
      IF p_fieldname EQ 'KTMNG'.
        wa_fieldcat-edit = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " ADD_FIELDCAT
    Regards,
    Jovito

  • Quantity field in ALV

    Hello All,
          I am using OO - ALV in which I am displaying a quantity field.This field is an editable field and if user tries to change the value and SAVE , it is taking some wrong values.
    Say suppose I am having 1.000 as the initial value and if user changes it to 2.000 and saves it is converted to .002.
    I tried with qfieldname , ref_fieldname of fieldcat but of no use. Anything apart from this will be highly appreciated.
    Regards,
    Dhwani

    User might be changing the value to only 2 and you might have declared the fieldcat with 2-3 decimal places. If you enter value with decimals say 2.001 it will take.
    Otherwise you need to replace it with char value as Nanda has suggested.
    Hope it helps.
    Thanks,
    Jayant

  • Quantity field in ALV Grid

    I am using KWMENG data element in my ALV grid which is a quantity field. In normal dialog programming this field does not allows entering characters in editable cells. But in ALV grid I am not able to restrict it from entering characters.
    Eg: In VA01 if we try to enter any character "ABC...Z" then it wouldn't be typed in the screen. But when using the same data element in ALV grid iot allows to enter alphanumeric values. Since it's a quantity field so character value gives a short dump. I know I can restrict the dump by using "NA" in comparing string but I want to knw is there a way by which I restrict character field entry in alv grid, the same way this field works in VA01. I checked with a simple dialog prog and in that also it doesn not allows character typing in editable fields.

    simple solution
    mention the ref_fieldname and ref_tablename in the fieldcatalog for that column.
    ex:
    fieldcat-ref_fieldname = 'KWMENG'.
    fieldcat-ref_tablename = 'VBAP'.

Maybe you are looking for