What mandatory values to pass in bapi_po_change

Hi,
I want to change the Condition value of a material i.e basic value of material in PO.
what mandatory values required to pass to BAPI_PO_CHANGE.
pl send along with the sample .example.
Helpfull ans will be rewarded.
Note : I am creating po using BAPI_PO_CREATE1. but condition values passing to POCOND are not getting reflected due to Info records that is the reason why i am going for po change.

hi.
check this examples.
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
REPORT Z_SALES_ORDER_CHANGE
NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 65(0)
MESSAGE-ID ZZ.
TABLES: VBAP.
DATA:
V_FILEIN(90) TYPE C,
V_RECIN TYPE I,
V_RECVBAP TYPE I,
V_RECORDER TYPE I,
V_VBELN LIKE VBAP-VBELN,
ORDERHEADERINX LIKE BAPISDH1X.
DATA: BEGIN OF I_ORDERS OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
BRGEW(18) TYPE C,
VOLUM(18) TYPE C,
END OF I_ORDERS.
DATA: BEGIN OF I_OUTPUT OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
GEWEI LIKE VBAP-GEWEI,
BRGEW LIKE VBAP-BRGEW,
VOLUM LIKE VBAP-VOLUM,
CKWGT TYPE C,
CKVOL TYPE C,
END OF I_OUTPUT.
DATA: BEGIN OF ORDERITEMIN OCCURS 0.
INCLUDE STRUCTURE BAPISDITM.
DATA: END OF ORDERITEMIN.
DATA: BEGIN OF ORDERITEMINX OCCURS 0.
INCLUDE STRUCTURE BAPISDITMX.
DATA: END OF ORDERITEMINX.
DATA: BEGIN OF RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF RETURN.
DATA: BEGIN OF BAPIRETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF BAPIRETURN.
PARAMETERS:
P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
START-OF-SELECTION.
CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
OPEN DATASET
IF V_FILEIN IS INITIAL.
MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
ELSE.
OPEN DATASET V_FILEIN
FOR INPUT
IN TEXT MODE.
IF SY-SUBRC = 0.
READ DATASET
DO.
READ DATASET V_FILEIN INTO I_ORDERS.
IF SY-SUBRC = 0.
APPEND I_ORDERS.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET
CLOSE DATASET V_FILEIN.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
ENDIF.
ELSE.
MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
ENDIF.
ENDIF.
SORT AND REMOVE DUPLICATES FROM I_ORDERS
SORT I_ORDERS BY VBELN POSNR.
DELETE ADJACENT DUPLICATES FROM I_ORDERS.
POPULATE I_OUTPUT
LOOP AT I_ORDERS.
SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
SELECT SINGLE BRGEW VOLUM
FROM VBAP
INTO (VBAP-BRGEW, VBAP-VOLUM)
WHERE VBELN = I_ORDERS-VBELN
AND POSNR = I_ORDERS-POSNR.
IF SY-SUBRC = 0.
IF VBAP-BRGEW = 0.
I_OUTPUT-CKWGT = 'X'.
ENDIF.
IF VBAP-VOLUM = 0.
I_OUTPUT-CKVOL = 'X'.
ENDIF.
I_OUTPUT-VBELN = I_ORDERS-VBELN.
I_OUTPUT-POSNR = I_ORDERS-POSNR.
I_OUTPUT-GEWEI = 'ST'.
I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
APPEND I_OUTPUT.
CLEAR: I_OUTPUT.
ENDIF.
V_RECIN = V_RECIN + 1.
ENDLOOP.
POPULATE BAPI DATA AND RUN BAPI
CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ORDERHEADERINX-UPDATEFLAG = 'U'.
LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
V_RECVBAP = V_RECVBAP + 1.
IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
CLEAR: ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ENDIF.
ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
IF NOT I_OUTPUT-CKWGT IS INITIAL.
ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
ORDERITEMINX-GROSS_WGHT = 'X'.
ENDIF.
IF NOT I_OUTPUT-CKVOL IS INITIAL.
ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
ORDERITEMINX-VOLUME = 'X'.
ENDIF.
APPEND ORDERITEMIN.
ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMINX-UNTOF_WGHT = 'X'.
ORDERITEMINX-UPDATEFLAG = 'U'.
APPEND ORDERITEMINX.
V_VBELN = I_OUTPUT-VBELN.
ENDLOOP.
RUN BAPI ON LAST ORDER
IF NOT ORDERITEMIN IS INITIAL.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
ENDIF.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
SKIP.
TOP OF PAGE
TOP-OF-PAGE.
WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
100(8) TEXT-H02, 126(8) SY-PAGNO.
WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
20(77) TEXT-H04,
100(8) TEXT-H05, 108(25) SY-REPID.
WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
20(4) TEXT-H07, 25(32) SY-HOST,
100(13) TEXT-H08, 121(8) SY-SYSID,
129 '/', 130(3) SY-MANDT.
ULINE.
SKIP.
regards.
sowjanya.b

Similar Messages

  • What values  to pass the import values of FM -KAUF_AUFNR_CHANGE.

    Hi,
    what values  to pass the import values of FM -KAUF_AUFNR_CHANGE.., Since the fields in FM are different from the values of database table fields.

    Hi,
    the import parameters in the FM are type of structures. it basically acts as a work area.
    when you execute the FM, and click on the icon in front of the field, for example, I_AFKO, and then you can enter the values you want to.
    Hope it helps,
    Preet

  • What values to pass in BAPI BAPI_PO_CREATE1 for conditions

    Hi,
    what necessary values to be passed to conditions tables in bapi BAPI_PO_CREATE1
    tables are :
    POCONDHEADER =
    POCONDHEADERX =
    POCOND =
    POCONDX =
    I am just paassing item number, condition type ,condition value they are reflecting in created PO.
    Helpfull answeres will be rewarded.

    Check this code u will get some idea of how to create a PO
    REPORT  zvk_bapi_po                                                 .
    DATA: s_poheader  LIKE bapimepoheader,
          f_pono      LIKE bapimepoheader-po_number,
          s_poheaderx LIKE bapimepoheaderx,
          s_versions  LIKE bapimedcm,
          t_poitem    LIKE bapimepoitem         OCCURS 0 WITH HEADER LINE,
          t_poitemx   LIKE bapimepoitemx        OCCURS 0 WITH HEADER LINE,
          t_addr      LIKE bapimepoaddrdelivery OCCURS 0 WITH HEADER LINE,
          t_schedule  LIKE bapimeposchedule     OCCURS 0 WITH HEADER LINE,
          t_schedulex LIKE bapimeposchedulx     OCCURS 0 WITH HEADER LINE,
          t_account   LIKE bapimepoaccount      OCCURS 0 WITH HEADER LINE,
          t_accountx  LIKE bapimepoaccountx     OCCURS 0 WITH HEADER LINE,
          t_return    like BAPIRET2             OCCURS 0 WITH HEADER LINE.
    Fill data
    *__ Header
    s_poheader-comp_code   = '1000'.
    s_poheader-doc_type    = 'ZIPS'.
    s_poheader-created_by  = 'XXX'.
    s_poheader-vendor      = '0001000441'.
    s_poheader-purch_org   = 'EC01'.
    s_poheader-pur_group   = '569'.
    s_poheader-currency    = 'USD'.
    s_poheaderx-comp_code   = 'X'.
    s_poheaderx-doc_type    = 'X'.
    s_poheaderx-created_by  = 'X'.
    s_poheaderx-vendor      = 'X'.
    s_poheaderx-purch_org   = 'X'.
    s_poheaderx-pur_group   = 'X'.
    s_poheaderx-currency    = 'X'.
    s_versions-post_date    = '06/05/2006'   .
    s_versions-completed    = 'X'     .
    s_versions-reason       = '0001'     .
    s_versions-description  = 'APPROVED BY KRISH' .
    s_versions-req_by       = 'HBE8328'.
    t_poitem-short_text     =  '0005-000721'.
    t_poitem-plant          =  '5002'.
    t_poitem-trackingno     =  '1000002151'.
    t_poitem-matl_group     =  'MG0001'.
    t_poitem-quantity       =  '8.000'.
    t_poitem-po_unit        =  'EA'.
    t_poitem-orderpr_un     =  'EA'.
    t_poitem-net_price      =  '109.880000000'.
    t_poitem-price_unit     =  '1'.
    t_poitem-acctasscat     =  'K'.
    t_poitem-preq_name      =  'ABC'.
    t_poitemx-po_itemx       =  'X'.
    t_poitemx-short_text     =  'X'.
    t_poitemx-plant          =  'X'.
    t_poitemx-trackingno     =  'X'.
    t_poitemx-matl_group     =  'X'.
    t_poitemx-quantity       =  'X'.
    t_poitemx-po_unit        =  'X'.
    t_poitemx-orderpr_un     =  'X'.
    t_poitemx-net_price      =  'X'.
    t_poitemx-price_unit     =  'X'.
    t_poitemx-acctasscat     =  'X'.
    t_poitemx-preq_name      =  'X'.
    t_addr-name               =  'CoCode 1000'.
    t_addr-name_2             =  'Company Code 1000'.
    t_addr-city               =  'Houston'.
    t_addr-postl_cod1         =  '77020-6237'.
    t_addr-street             =  '4100 Clinton Dr'.
    t_addr-country            =  'US'.
    t_addr-langu              =  'EN'.
    t_addr-region             =  'TX'.
    t_addr-sort1              =  'COCODE 1000'.
    t_addr-sort2              =  'COMPANY CODE 1000'.
    t_addr-time_zone          =  'CST'.
    t_addr-comm_type          =  'INT'.
    t_addr-tel1_numbr         =  '7137534000'.
    t_addr-e_mail             =  '[email protected]'.
    t_addr-countryiso         =  'US'.
    t_addr-langu_iso          =  'EN'.
    t_schedule-sched_line    = '0001'.
    t_schedule-delivery_date = '04/17/2006'.
    t_schedule-quantity      = '8.000'.
    t_schedule-preq_no       = '5000000050'.
    t_schedule-preq_item     = '00010'.
    t_schedulex-sched_line    = '0001'.
    t_schedulex-delivery_date = 'X'.
    t_schedulex-quantity      = 'X'.
    t_schedulex-preq_no       = 'X'.
    t_schedulex-preq_item     = 'X'.
    t_account-serial_no        = '01'.
    t_account-gl_account       = '0000500200'.
    t_account-costcenter       = '1000000297'.
    t_account-gr_rcpt          = '3227'.
    t_account-co_area          = 'CNTC'.
    t_account-profit_ctr       = '1000000297'.
    t_accountx-serial_no        = '01'.
    t_accountx-gl_account       = 'X'.
    t_accountx-costcenter       = 'X'.
    t_accountx-gr_rcpt          = 'X'.
    t_accountx-co_area          = 'X'.
    t_accountx-profit_ctr       = 'X'.
    t_poitem-po_item       = '00000'.
    t_poitemx-po_item      = '00000'.
    t_addr-po_item         = '00000'.
    t_schedule-po_item     = '00000'.
    t_account-po_item      = '00000'.
    t_accountx-po_item     = '00000'.
    DO 50 TIMES.
      t_poitem-po_item       = t_poitem-po_item + 1.
      APPEND t_poitem.
      t_poitemx-po_item      = t_poitemx-po_item + 1.
      APPEND t_poitemx.
    t_addr-po_item         = t_addr-po_item + 1.
    APPEND t_addr.
      t_schedule-po_item     = t_schedule-po_item + 1.
      APPEND t_schedule.
      t_schedulex-po_item    = t_schedulex-po_item + 1.
      APPEND t_schedulex.
      t_account-po_item      = t_account-po_item + 1.
      APPEND t_account.
      t_accountx-po_item     = t_accountx-po_item + 1.
      APPEND t_accountx.
    ENDDO.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        poheader         = s_poheader
        poheaderx        = s_poheaderx
        versions         = s_versions
      IMPORTING
        exppurchaseorder = f_pono
    TABLES
       RETURN                       = t_return
       poitem                       = t_poitem
       poitemx                      = t_poitemx
       poaddrdelivery               = t_addr
       poschedule                   = t_schedule
       poschedulex                  = t_schedulex
       poaccount                    = t_account
       poaccountx                   = t_accountx   .
       WRITE: 'PO No:', f_pono.

  • How to find what values were passed onto a store procedure at the last run

    my web application is calling a store procedure but not returning the desired results in the ASP.net page
    when i execute the store procedure in sql server by providing the same values i get the desired result
    is there any way i could tell what values were passed onto the store procedure when it was called by the web page
    i am using sql server 2012 express 

    To add to the Profiler suggestion, you can also capture this information using Extended Events.  Below is a script example to capture RPC and batch completed events.  This can be done from the SSMS Object Explorer as well:
    --create ExtendedEvent session
    CREATE EVENT SESSION [ParameterTrace] ON SERVER
    ADD EVENT sqlserver.rpc_completed(
    ACTION(sqlserver.sql_text)),
    ADD EVENT sqlserver.sql_batch_completed(
    ACTION(sqlserver.sql_text))
    ADD TARGET package0.event_file(SET filename=N'C:\Temp\ParameterTrace.xel')
    WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
    GO
    --start session
    ALTER EVENT SESSION [ParameterTrace] ON SERVER
    STATE = START;
    GO
    --stop session
    ALTER EVENT SESSION [ParameterTrace] ON SERVER
    STATE = STOP;
    --query trace data
    SELECT CAST(event_data AS XML) AS event_data
    FROM sys.fn_xe_file_target_read_file(N'C:\temp\ParameterTrace*', default, default, default);
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • What is the Parameter values for passing a password to open a pdf

    I need help in finding the Parameter values for passing a password to open a pdf(s)? The software is written in Delphi.

    The Copy Protection only protects our Disk from being duplicated and also protects our Software from being copied and used locally.
    As far as the password encryption, that is why I created the Post. I was hoping that the password can be coded in our Software to open the password protect PDF that we create. This option would of gave us the security for when the customer copies the pdf to there local drive they would be required to input the password which they would not have access to.

  • What and How to pass Line Num (or ID) to a function?? (from OM Or der Line: "Line Flo

    Greetings, and thanks in advance for any advice you can provide.
    I'm looking at the predefined Workflow "OM Order Line" and a process in it called "Line Flow - Configuration". We're wanting to pass the Line Number (or Line ID) from the Workflow to a custom function, at a specific place in the WF that we've identified. The only attribute that looks at all relevant to pass is "AFAS_Line_ID".
    I've duplicated the "Line Flow - Configuration" process, and created a test notification to display the contents of "AFAS_Line_ID" when the workflow is run, but the value of "AFAS_Line_ID" always appears to be empty/blank/null whenever I create an order the generate the lines. "AFAS_Line_ID" also appears to be empty/null when viewing the attributes behind the WF process, at any and every step in the process.
    The attribute "AFAS Line ID" seems like the only thing even remotely related to what we need to pass, as all the other attributes are things like User ID, App ID, Responsibily ID, OM WF Admin, Org ID, Lead Time Rollup Org, Lead Time Rollup Config Item, Lead Time Date, Lead Time Category Struction, Line Catagory, Lead Time Attribute Reg ID, Lead Time Request ID, Line Short Descriptor, and Notification Approver.
    How can we pass a reference to the current line being processed within the workflow, and specifically - WHAT should we be passing??
    Thanks again for your help, preferably much sooner than later. -- Tom Buck
    [email protected], or post replies here to this forum.

    Tom
    I can only answer in terms of workflow technology. It is possible that there are item attributes that exist which you can use in some SQL to derive the real value you are looking for. For example, there might exist an Item Attribute with the Primary Key for the row you are looking for, and you write some SQL to get the column form that row. You can use the wf_engine.GetItemAttr APIs to get Item Attribute values for a given work item.
    Cheers
    Mark
    Greetings, and thanks in advance for any advice you can provide.
    I'm looking at the predefined Workflow "OM Order Line" and a process in it called "Line Flow - Configuration". We're wanting to pass the Line Number (or Line ID) from the Workflow to a custom function, at a specific place in the WF that we've identified. The only attribute that looks at all relevant to pass is "AFAS_Line_ID".
    I've duplicated the "Line Flow - Configuration" process, and created a test notification to display the contents of "AFAS_Line_ID" when the workflow is run, but the value of "AFAS_Line_ID" always appears to be empty/blank/null whenever I create an order the generate the lines. "AFAS_Line_ID" also appears to be empty/null when viewing the attributes behind the WF process, at any and every step in the process.
    The attribute "AFAS Line ID" seems like the only thing even remotely related to what we need to pass, as all the other attributes are things like User ID, App ID, Responsibily ID, OM WF Admin, Org ID, Lead Time Rollup Org, Lead Time Rollup Config Item, Lead Time Date, Lead Time Category Struction, Line Catagory, Lead Time Attribute Reg ID, Lead Time Request ID, Line Short Descriptor, and Notification Approver.
    How can we pass a reference to the current line being processed within the workflow, and specifically - WHAT should we be passing??
    Thanks again for your help, preferably much sooner than later. -- Tom Buck
    [email protected], or post replies here to this forum.

  • Is there a way to tell what is actually being passed to DB from PreparedSta

    Is there a way to tell what is actually being passed to DB from PreparedStatement? What I mean by that is that I have a PreparedStatement that is a simple
    prepstmt = connection.prepareStatement("Insert into table (col1, col2, col3, .... colx) values (?,?,?....?)");
    (there are x ?s)
    I precompile this, and later, when there is a connection I call set all the variables
    prepstmt.setInt(1, someint); prepstmt.setString(2, "\\'" + somestring + "\\'"); etc... prepstmt.executeUpdate();
    I get back an exception thrown by Oracle complaining that one of my values is too large for the column (but doesn't say what column/value).
    So I made a string that contains what ought to be the same query
    String debug = "Insert into table (col1, col2, col3, .... colx) values (someint,'somestring',etc....someotherint)"; System.out.println(debug);
    I give the printed out line directly to Oracle through SQLScratchpad and it works just fine in there and I can confirm the row has been inserted. Nothing is too big.
    Is there a way to look at what the PreparedStatement actually has as values in there? I found I could look at the original statement (the one with the ?s) if I expand the prepstmt object in the debugger's (Eclipse) view, but nothing to show me where the values were filled in.
    Thanks for any help you can give me.

    Hrm, I'm suspecting that perhaps it has to do something with setting CHAR fields. Some of the fields in this table are CHAR but I don't see a call in my PreparedStatement that can set a char, only a String, so that's what I've been using, but it may be that that's not the right thing to do. I'm running Java 1.5.10, and looking through the API there doesn't seem to be anything specifically for char.

  • Values not passing from program to Layout

    Hi Abaper's
    My requirement is I need to set company logo in Invoice ( VF03 ) if a particualar condition satisifies, for this I have set a FLAG in my
    driver program and called the FLAG in my Script Layout.
    Here my issue is, for certain invoices the FLAG set in the program is being called in the Layout and Logo is displayed in invoice copy ( when excuted both in foreground and back ground).
    But in certain invoices, if run in foreground none of the values ( means not only flag but also all the values to be passed to layout)
    is displayed in invoice. It is only displaying the hard coded values in the layout ( showing blank page ).
    and if I run in background all the values are passing to layout except all Global Variables (flags) in the program even though it
    has value in the program.
    Please advice what should be the problem, I have checked with my Functional and it seems to be fine in customization part.
    Karthik
    Edited by: Karthik R on Sep 21, 2010 2:42 PM

    Hi Tamas,
    I have tried it, but still not able to figure out the exact problem....since while running in background or foreground some of the all values including my logo are displayed in invoice but for some invoices none of the values from driver prgram is getting passed to layout while running in forground....but when run in background all values are passing except the FLAG set in the drvier program.
    what should be the reason for this ? for some invoices all the values from driver is passing to layout but for some cases its not passing

  • Sending a return value without pass/fail message

    Hi,
    I'm using the COM adapter to talk TestComplete application.
    I have a string value test step to evaluate a return value and determine if it's pass or fail (e.g. return 0 = pass, return 1 = fail).  This works perfectly.
    However, I have added another return value (e.g. return 2), the code executed fine, but it keeps displaying that step as "Failed", which is annoying.  Is there a way to suppress this failed message?
    Basically, here's what I need to do, return 0= display pass, return 1 = display fail, return 2 = display no message or just display done.
    Thanks so much!
    Solved!
    Go to Solution.

    The String Value Test step type only evaluates to Passed or Failed.  It does not do a tristate.  In fact any of the step types in the Tests (Pass/Fail Test, Numeric Limit Test, Multiple Numeric Limit Test, String Value Test) will always be pass or fail.  They never evaluate to just done.
    The Status Expression is what makes a step Pass or Fail.  Unfortunately with the default steps you cannot change the Status Expression.  You have to create a custom step type to do that.
    What are you setting your Step.Result.String to?  Or did you change the Data Source?
    Here are 3 options:
    1- Create a custom step based on the String Value Limit test and change the Status Expression such that you get your desired behavior
    2- Use and Action step and change the Status Expression such that you get your desired behavior.
    3- Continue using the step you are using but in the Post-Expression place some logic which turns off the Step.StepFailCausesSequenceFail if you are in return 2 state
    http://zone.ni.com/devzone/cda/tut/p/id/4302
    Hope this helps
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • What parameters should i pass inorder to upload an excel file in gui_upload

    what parameters should i pass inorder to upload an excel file in gui_upload
    Thanks in advance.
    Ahmed.

    check below program....
    *& Report  UPLOAD_EXCEL                                                *
    *& Upload and excel file into an internal table using the following    *
    *& function module: ALSM_EXCEL_TO_INTERNAL_TABLE                       *
    REPORT  UPLOAD_EXCEL no standard page heading.
    *Data Declaration
    data: itab like alsmex_tabline occurs 0 with header line.
    Has the following format:
                Row number   | Colum Number   |   Value
         i.e.     1                 1             Name1
                  2                 1             Joe
    TYPES: Begin of t_record,
        name1 like itab-value,
        name2 like itab-value,
        age   like itab-value,
        End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
          wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = p_infile
                i_begin_col             = '1'
                i_begin_row             = '2'  "Do not require headings
                i_end_col               = '14'
                i_end_row               = '31'
           tables
                intern                  = itab
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      if sy-subrc <> 0.
        message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
      endif.
    Sort table by rows and colums
      sort itab by row col.
    Get first row retrieved
      read table itab index 1.
    Set first row retrieved to current row
      gd_currentrow = itab-row.
      loop at itab.
      Reset values for next row
        if itab-row ne gd_currentrow.
          append wa_record to it_record.
          clear wa_record.
          gd_currentrow = itab-row.
        endif.
        case itab-col.
          when '0001'.                              "First name
            wa_record-name1 = itab-value.
          when '0002'.                              "Surname
            wa_record-name2 = itab-value.
          when '0003'.                              "Age
            wa_record-age   = itab-value.
        endcase.
      endloop.
      append wa_record to it_record.
    *!! Excel data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • TO REMOVE BLOCK WHAT I NEED TO PASS IN BDCTAB ???

    Hi,
    This is Biswajit. kindly help me to solve this problem.....................
    The program will select all deliveries according to the selection criteria :
    • Sales organization (Mandatory)
    • Distribution channel (Mandatory)
    • Plant (Optional)
    • Delivery (Optional)
    Only deliveries with delivery type ‘Zaaa’, ‘Zbbb’, ‘Zccc’, ‘Zddd’ containing
    a  ‘xx’ block have to be processed which are completely related to batch
    determination.
    • select all items which are batch relevant and have no batch assigned.
    o For each selected item select the sub-items which are assigned to a
    batch and count the “quantity to be delivered”.
    o Consider a delivery item as completely related to batch determination
    when the “quantity to be delivered” on item-level is equal to the total
    calculated “quantity to be delivered” on sub-item level.
    • Consider a delivery as completely related to batch determination when
    all delivery items are completely related to batch determination.
    The removal of the ‘BA’ block has to be carried out using the batch-input
    technique for transaction VL02N (Change delivery).
    NOW IF I WANT TO CODE BDC FOR VL02N TO REMOVE BLOCK WHAT I NEED TO PASS IN BDCTAB . 
    PLEASE REPLY AS EARLY.
    Thanks

    Hello Gints99,
    If the device is in recovery mode then I suggest plugging the phone into the comptuer and restoring with iTunes.
    Here is an article with more information about recovery mode:
    iOS: Unable to update or restore
    http://support.apple.com/kb/ht1808
    Cheers,
    Sterling

  • Alert.show in ActionScript: Which value to pass as "Parent"

    For CS5 and ActionScript:
    When debugging my InDesign Extension, I occaionally get random exceptions thrown without an indication of where on the stack it was thrown. I suspect that this is being caused by Alert.show, and I further suspect that it is due to the value I pass for "parent", I have tried "this" and "Sprite(mx.core.Application.application)".
    E.g.,
    Alert.show("Place Block succeeded","",Alert.OK, Sprite(mx.core.Application.application));
    What should I be using?
    TIA
    mlavie

    Hi Lavie,
    This question is really more appropriate for the CS SDK forum, but...
    The correct way to do it is:
    Alert.show("text", "title", Alert.OK, Sprite(mx.core.Application.application));
    See here:
    http://127.0.0.1:51088/help/topic/com.adobe.cside.docs/programmers_guide/customizing_the_u i.htm
    FWIW, I usually use jsxInterface.alert(alertString). You get a much more standard looking (synchronous) alert dialog like that...
    Harbs

  • 3000: Invalid value(s) passed for arguments. NID= ANAME=WF_NOTE

    Hello,
    I'm getting the following error when calling a HRMS Self-Service Workflow behind the scenes using pl/sql:
    3000: Invalid value(s) passed for arguments. NID= ANAME=WF_NOTE
    For this particular workflow I customized the Review Page function/node attribute "HR_APPROVAL_REQ_FLAG" value from "No" to "Yes - Dynamic Approval" so that it would use an Approval Management rule that we created.
    When I go to enter a simple name change through Employee Self-Service with the changes listed above, it works fine. When I try to mimic the name change by calling the Workflow through pl/sql, I get the error listed above. It is stopping right on the Approval Notification activity.
    I know that "NID" stands for notificaiton_id, and it appears to me that the NID value is null. I'm not sure how I can set this value or what I should do next. Any help would be appreciated.
    Thanks

    the problem is with here.
    WF_Notification.respond(l_nid,p_result,p_user_name);
    and in the post notification function i call a procedure and code inside it is below
    l_nid           := wf_engine.context_nid;
    Wf_Engine.SetItemAttrNumber
    (itemtype     => itemtype,
         itemkey      => itemkey,
         aname      => 'NOTIFICATION_ID',
         avalue      => l_nid);
    vresult := wf_notification.GetAttrText(l_nid,'RESULT');
    if vresult is not null then
    resultout :=wf_engine.eng_completed||':'||wf_notification.GetAttrText(l_nid,'RESULT');
    else
    resultout :='COMPLETE';               
    end if;
    return;          
    end if;

  • Dynamic sql reurns no data when multiple values are passed.

    (Dynamic sql returns no data when multiple values are passed.)
    Hi,
    While executing the below dynamic sql in the procedure no data is returned when it has multiple input values.
    When the input is EMPID := '1'; the procedure works fine and returns data.Any suggestion why the procedure doen't works when input as EMPID := '1'',''2'; is passed as parameter?
    =======================================================
    create or replace PROCEDURE TEST(EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
    stmt VARCHAR2(9272);
    V_EMPID VARCHAR2(100);
    BEGIN
    V_EMPID :=EMPID;
    stmt := 'select * from TEST123 where Empid is NOT NULL';
    IF V_EMPID <> '-1' THEN
    stmt := stmt || ' and Empid in (:1)';
    ELSE
    stmt := stmt || ' and -1 = :1';
    END IF;
    OPEN rc FOR stmt USING V_EMPID;
    END Z_TEST;
    ============================================================
    Script for create table
    ==================================================================
    CREATE TABLE TEST123 (
    EMPID VARCHAR2(10 BYTE),
    DEPT NUMBER(3,0)
    ===========================================
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('1',20);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    =============================================
    Select * from TEST123 where Empid in (1,2,3)
    EMPID DEPT
    1     20
    2     10
    3     30
    3     30
    2     10
    ===================================================================
    Any suggestion why the procedure doen't works when input EMPID := '1'',''2';?
    Thank you,

    The whole scenario is a little strange. When I tried to compile your procedure it couldn't compile, but I added the missing info and was able to get it compiled.
    create or replace PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      IF V_EMPID = '-1' THEN
        stmt := stmt || ' and Empid in (:1)';
      ELSE
        stmt := stmt || ' and -1 = :1';
      END IF;
      OPEN rc FOR stmt USING V_EMPID;
    END;If you pass in 1 as a parameter, it is going to execute because the statement that it is building is:
    select * from TEST123 where Empid is NOT NULL and -1 = 1Although the syntax is valid -1 will never equal 1 so you will never get any data.
    If you pass in 1,2 as a parameter then it is basically building the following:
    select * from TEST123 where Empid is NOT NULL and -1 = 1,2This will cause an invalid number because it is trying to check where -1 = 1,2
    You could always change your code to:
    PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      stmt := stmt || ' and Empid in (:1)';
      OPEN rc FOR stmt USING V_EMPID;
    END;and forget the if v_empid = '-1' check. If you pass in a 1 it will work, if you pass in 1,2 is will work, but don't pass them in with any tick marks.

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

Maybe you are looking for