How to create CRUD application using bapi in webdynpro java
Hi All,
I have implemented the CRUD application using bapi Now i want to create, retrieve , update and delete the existing table by click on Insert, delete, retrieve ,and update button dynamically. i get null values from database, Please let me know the logic and procedure for how to create CRUD application using bapi Please any one help me..
Thanks in advance
Hi,
Hey tell me one thing your BAPI having CURD methods. See you are getting data from BAPI and pull the data in Table in WDJ. So if u can do any action it will comes trough BAPI.
If your BAPI having CURD methods. You can implement CURD methods in WDJAVA also.
@ You said you are getting null values from the database. Please let me know what code you have to wrote for CURD. Please tell me.
Hope this is help full for u
Best Regards
Vijay K
Similar Messages
-
How to create material doc using bapi
hi all,
pls tell me how to create material doc using bapi ,
if i give po no , it will create material doc no .
advance thanks ,Hi venu,
Please go thru this example, it will help u.
REPORT ZBAPIMM01 LINE-SIZE 255 NO STANDARD PAGE HEADING
LINE-COUNT 065(001).
TABLES: T001L, "Storage Locations
MARA, "General Material Data
MAKT, "Material Descriptions
MBEW, "Material Valuation
MARC. "Plant Data for Material
DATA: BAPI_HEAD LIKE BAPIMATHEAD,
BAPI_MAKT LIKE BAPI_MAKT, "Material Description
BAPI_MARA1 LIKE BAPI_MARA, "Client Data
BAPI_MARAX LIKE BAPI_MARAX,
BAPI_MARC1 LIKE BAPI_MARC, "Plant View
BAPI_MARCX LIKE BAPI_MARCX,
BAPI_MBEW1 LIKE BAPI_MBEW, "Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX,
BAPI_RETURN LIKE BAPIRET2.
DATA: BEGIN OF INT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF INT_MAKT.
DATA: BEGIN OF INT_MAT OCCURS 100,
WERKS(4), "Plant
MTART(4), "Material type
MATNR(18), "Material number
MATKL(9) , "Material group
MBRSH(1), "Industry sector
MEINS(3), "Base unit of measure
GEWEI(3), "Weight Unit
SPART(2), "Division
EKGRP(3), "Purchasing group
VPRSV(1), "Price control indicator
STPRS(12), "Standard price
PEINH(3), "Price unit
SPRAS(2), "Language key
MAKTX(40), "Material description
END OF INT_MAT.
SELECT-OPTIONS:
PLANT FOR MARC-WERKS OBLIGATORY MEMORY ID PLT,
MATERIAL FOR MARA-MATNR MEMORY ID MAT,
MATLTYPE FOR MARA-MTART MEMORY ID MTY,
DIVISION FOR MARA-SPART MEMORY ID DIV.
PARAMETERS: F_FILE LIKE RLGRAP-FILENAME
DEFAULT 'C:\DATA\ZMATERIAL.XLS' MEMORY ID F_FILE,
GETDATA AS CHECKBOX, "Tick to download materials data to local harddisk
UPDDATA AS CHECKBOX. "Tick to update date to Materials Master
IF GETDATA = 'X'.
PERFORM DOWNLOAD_DATA.
PERFORM DOWNLOAD_FILE.
ENDIF.
IF UPDDATA = 'X'.
PERFORM UPLOAD_FILE.
PERFORM UPDATE_MM.
ENDIF.
FORM DOWNLOAD_DATA.
SELECT * FROM MARC WHERE LVORM EQ ' '
AND WERKS IN PLANT
AND MATNR IN MATERIAL.
CLEAR MARA.
SELECT SINGLE * FROM MARA WHERE MATNR = MARC-MATNR.
CHECK MATLTYPE.
CHECK DIVISION.
CLEAR MBEW.
SELECT SINGLE * FROM MBEW WHERE MATNR = MARC-MATNR
AND BWKEY = MARC-WERKS.
CLEAR MAKT.
SELECT SINGLE * FROM MAKT WHERE SPRAS = 'EN'
AND MATNR = MARC-MATNR.
WRITE:/ MARC-WERKS, "Plant
MARA-MTART, "Material type
MARA-MATNR, "Material number
MARA-MATKL, "Material group
MARA-MBRSH, "Industry sector
MARA-MEINS, "Base unit of measure
MARA-GEWEI, "Weight Unit
MARA-SPART, "Division
MARC-EKGRP, "Purchasing group
MBEW-VPRSV, "Price control indicator
MBEW-STPRS, "Standard price
MBEW-PEINH, "Price unit
MAKT-SPRAS, "Language key
MAKT-MAKTX. "Material description
INT_MAT-WERKS = MARC-WERKS. "Plant
INT_MAT-MTART = MARA-MTART. "Material type
INT_MAT-MATNR = MARA-MATNR. "Material number
INT_MAT-MATKL = MARA-MATKL. "Material group
INT_MAT-MBRSH = MARA-MBRSH. "Industry sector
INT_MAT-MEINS = MARA-MEINS. "Base unit of measure
INT_MAT-GEWEI = MARA-GEWEI. "Weight Unit
INT_MAT-SPART = MARA-SPART. "Division
INT_MAT-EKGRP = MARC-EKGRP. "Purchasing group
INT_MAT-VPRSV = MBEW-VPRSV. "Price control indicator
INT_MAT-STPRS = MBEW-STPRS. "Standard price
INT_MAT-PEINH = MBEW-PEINH. "Price unit
INT_MAT-SPRAS = MAKT-SPRAS. "Language key
INT_MAT-MAKTX = MAKT-MAKTX. "Material description
APPEND INT_MAT.
CLEAR INT_MAT.
ENDSELECT.
ENDFORM.
FORM DOWNLOAD_FILE.
call function 'WS_DOWNLOAD'
EXPORTING
FILENAME = F_FILE
FILETYPE = 'DAT'
FILETYPE = 'WK1'
tables
data_tab = INT_MAT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
FORMAT COLOR COL_GROUP.
WRITE:/ 'Data Download Successfully to your local harddisk'.
SKIP.
ENDIF.
ENDFORM.
FORM UPLOAD_FILE.
call function 'WS_UPLOAD'
EXPORTING
FILENAME = F_FILE
FILETYPE = 'DAT'
FILETYPE = 'WK1'
tables
data_tab = INT_MAT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
FORMAT COLOR COL_GROUP.
WRITE:/ 'Data Upload Successfully from your local harddisk'.
SKIP.
ENDIF.
ENDFORM.
FORM UPDATE_MM.
LOOP AT INT_MAT.
Header
BAPI_HEAD-MATERIAL = INT_MAT-MATNR.
BAPI_HEAD-IND_SECTOR = INT_MAT-MBRSH.
BAPI_HEAD-MATL_TYPE = INT_MAT-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
Material Description
REFRESH INT_MAKT.
INT_MAKT-LANGU = INT_MAT-SPRAS.
INT_MAKT-MATL_DESC = INT_MAT-MAKTX.
APPEND INT_MAKT.
Client Data - Basic
BAPI_MARA1-MATL_GROUP = INT_MAT-MATKL.
BAPI_MARA1-BASE_UOM = INT_MAT-MEINS.
BAPI_MARA1-UNIT_OF_WT = INT_MAT-GEWEI.
BAPI_MARA1-DIVISION = INT_MAT-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
Plant - Purchasing
BAPI_MARC1-PLANT = INT_MAT-WERKS.
BAPI_MARC1-PUR_GROUP = INT_MAT-EKGRP.
BAPI_MARCX-PLANT = INT_MAT-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
Accounting
BAPI_MBEW1-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEW1-PRICE_CTRL = INT_MAT-VPRSV.
BAPI_MBEW1-STD_PRICE = INT_MAT-STPRS.
BAPI_MBEW1-PRICE_UNIT = INT_MAT-PEINH.
BAPI_MBEWX-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
WRITE:/ BAPI_HEAD, BAPI_MARC1.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = BAPI_MVKE1
SALESDATAX = BAPI_MVKEX
STORAGETYPEDATA =
STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = INT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error Message ', BAPI_RETURN.
ENDIF.
ENDLOOP.
ENDFORM.
*---End of Program
Reagrds,
Kumar -
HOW TO CREATE PURCHASE ORDER USING BAPI
HI FRIENDS,
I HAVE URGENT REQUIREMNT ,TO CREATE PURCHASE ORDER USING BAPI.PLS HELP ON THIS.
UR'S
RAVIHi
See the sample code and do accordingly
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
Reward points if useful
Anji -
How to create sales order using BAPI.
Hi all,
I am trying to create sales order using standard BAPI
"BAPI_SALESORDER_CREATEFROMDAT2". But, even I had entered all mandatory fields, I am unable to create sales order sucessfully.
I had gone through the documentaion of this BAPI and entered these fields.
These are the mandatory fields that which I had tried to create,
ORDER_HEADER_IN :
DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_PARTNERS..:
PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..:
MATERIAL Material number
Do we have anymore fields to give as inputs? I am getting this error message as below :
Msg: Personal number 00007176 does not exit.
But, I am not giving any personal number manually. This personal number was having connection with partner role field,
I had reffered this from the VBPA (Sales Document: Partner Table). Now, please suggest me how to solve this?
Can anyone tell me how to solve this problem and create sales order sucessfully.
Thanks in advance,
Surender Batlanki.hi surendra ,
chech with below code.
REPORT z_bapi_salesorder_create.
Parameters
Sales document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
PARAMETERS: p_auart TYPE auart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Sales organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Distribution channel
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Division.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Sold-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Ship-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Material
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Quantity.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Initialization.
INITIALIZATION.
v_text = 'Order type'.
v_text1 = 'Sales Org'.
v_text2 = 'Distribution channel'.
v_text3 = 'Division'.
v_text4 = 'Sold-to'.
v_text5 = 'Ship-to'.
v_text6 = 'Material'.
v_text7 = 'Quantity'.
v_text9 = 'Plant'.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
Ship to
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Call the BAPI to create the sales order.
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Check the return table.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in creating document'.
ELSE.
Commit the work.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
let us know if you have any qauistions.
~linganna -
How to create sales order using bapi( test purpose)
Hi all,
while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,
version 0 is not defined for the fiscal year ****.
I have given the fallowing parameters as input
ORDER_HEADER_IN
DOC_TYPE OR
SALES_ORG 1000
DISTR_CHAN 10
DIVISION 00
ORDER_PATNERS
PARTN_ROLE SP
PARTN_NUMB 1000
ORDER_ITEMSIN
MATERIAL M-13
I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).
Regards
Deviprasad.Hi Prasad,
Try using BAPI_SALESORDER_CREATEFROMDAT2.
While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.
Pricing Conditions will not be mandatory to create a sales order via BAPI.
As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.
Also try to pass the item number internally, this will help you in identifying the schedule lines.
Regards,
Priyanka. -
How to Create Sales Order using BAPI with Variant configurations
Hi All,
I need to create a sales order using BAPI BAPI_SALESORDER_CREATEFROMDAT2 with Varaint confiugartions. I will get Header ITEM and variant configuration items in the flat file. Kindly help me in this regard.
One more thing, is there any way to findout all the Varaint classifications for a particular Material?
I have done the below coding. Sales order is getting created but variant configurations are not populating.
*...Configuration: Reference Data
DATA: gt_order_cfgs_ref TYPE TABLE OF bapicucfg,
wa_order_cfgs_ref TYPE bapicucfg.
*...Configuration: Instances
DATA: gt_order_cfgs_inst TYPE TABLE OF bapicuins,
wa_order_cfgs_inst TYPE bapicuins.
*...Configuration: Part-of Specifications
DATA: gt_order_cfgs_part_of TYPE TABLE OF bapicuprt,
wa_order_cfgs_part_of TYPE bapicuprt .
*...Configuration: Characteristic Values
DATA: gt_order_cfgs_value TYPE TABLE OF bapicuval,
wa_order_cfgs_value TYPE bapicuval.
*...Configuration: BLOB Internal Data (SCE)
DATA: gt_order_cfgs_blob TYPE TABLE OF bapicublb ,
wa_order_cfgs_blob TYPE bapicublb.
*...Configuration: Variant Condition Key
DATA: gt_order_cfgs_vk TYPE TABLE OF bapicuvk,
wa_order_cfgs_vk TYPE bapicuvk.
*...Configuration: Reference Item / Instance
DATA: gt_order_cfgs_refinst TYPE TABLE OF bapicuref,
wa_order_cfgs_refinst TYPE bapicuref.
*...Configuration: Reference Data
wa_order_cfgs_ref-posex = '10'.
wa_order_cfgs_ref-config_id = '1'.
wa_order_cfgs_ref-root_id = '1'.
wa_order_cfgs_ref-SCE = '1'.
wa_order_cfgs_ref-CBASE_ID_TYPE = 'G'.
wa_order_cfgs_ref-CONSISTENT = 'T'.
wa_order_cfgs_ref-COMPLETE = 'T'.
APPEND wa_order_cfgs_ref TO gt_order_cfgs_ref.
*..2nd item
wa_order_cfgs_ref-posex = '20'.
wa_order_cfgs_ref-config_id = '2'.
wa_order_cfgs_ref-root_id = '1'.
wa_order_cfgs_ref-SCE = '1'.
wa_order_cfgs_ref-CBASE_ID_TYPE = 'G'.
wa_order_cfgs_ref-CONSISTENT = 'T'.
wa_order_cfgs_ref-COMPLETE = 'T'.
APPEND wa_order_cfgs_ref TO gt_order_cfgs_ref.
*...Configuration: Instances
wa_order_cfgs_inst-config_id = '1'.
wa_order_cfgs_inst-inst_id = '1'.
wa_order_cfgs_inst-obj_type = 'MARA'.
wa_order_cfgs_inst-class_type = '300'.
wa_order_cfgs_inst-obj_key = '2021B'.
wa_order_cfgs_inst-quantity = 1.
wa_order_cfgs_inst-PERSIST_ID_TYPE = 'G'.
wa_order_cfgs_inst-CONSISTENT = 'T'.
wa_order_cfgs_inst-COMPLETE = 'T'.
APPEND wa_order_cfgs_inst TO gt_order_cfgs_inst.
*..2nd item
wa_order_cfgs_inst-config_id = '2'.
wa_order_cfgs_inst-inst_id = '1'.
wa_order_cfgs_inst-obj_type = 'MARA'.
wa_order_cfgs_inst-class_type = '300'.
wa_order_cfgs_inst-obj_key = '2021B'.
wa_order_cfgs_inst-quantity = 1.
wa_order_cfgs_inst-PERSIST_ID_TYPE = 'G'.
wa_order_cfgs_inst-CONSISTENT = 'T'.
wa_order_cfgs_inst-COMPLETE = 'T'.
APPEND wa_order_cfgs_inst TO gt_order_cfgs_inst.
*...Configuration: Characteristic Values
wa_order_cfgs_value-config_id = '1'.
wa_order_cfgs_value-inst_id = '1'.
wa_order_cfgs_value-charc = 'BASIC_MACHINE'.
wa_order_cfgs_value-value = 'L28'.
wa_order_cfgs_value-VALCODE = '1'.
APPEND wa_order_cfgs_value TO gt_order_cfgs_value.
wa_order_cfgs_value-config_id = '1'.
wa_order_cfgs_value-inst_id = '1'.
wa_order_cfgs_value-charc = 'BUCKET'.
wa_order_cfgs_value-value = 'PL1001'.
wa_order_cfgs_value-VALCODE = '1'.
APPEND wa_order_cfgs_value TO gt_order_cfgs_value.
*..2nd item
wa_order_cfgs_value-config_id = '2'.
wa_order_cfgs_value-inst_id = '1'.
wa_order_cfgs_value-charc = 'BUCKET_FOC'.
wa_order_cfgs_value-value = '023OP0049'.
wa_order_cfgs_value-VALCODE = '1'.
APPEND wa_order_cfgs_value TO gt_order_cfgs_value.
wa_order_cfgs_value-config_id = '2'.
wa_order_cfgs_value-inst_id = '1'.
wa_order_cfgs_value-charc = 'BUCKET_HOE'.
wa_order_cfgs_value-value = '028MS0004'.
wa_order_cfgs_value-VALCODE = '1'.
APPEND wa_order_cfgs_value TO gt_order_cfgs_value.
wa_order_cfgs_value-config_id = '2'.
wa_order_cfgs_value-inst_id = '1'.
wa_order_cfgs_value-charc = 'TYRE_PRESSURE_GAUGE'.
wa_order_cfgs_value-value = '81004402'.
APPEND wa_order_cfgs_value TO gt_order_cfgs_value.
*...Configuration: Reference Item / Instance
wa_order_cfgs_refinst-posex = '10'.
wa_order_cfgs_refinst-config_id = '1'.
wa_order_cfgs_refinst-inst_id = '1'.
APPEND wa_order_cfgs_refinst TO gt_order_cfgs_refinst.
*..2nd item
wa_order_cfgs_refinst-posex = '20'.
wa_order_cfgs_refinst-config_id = '2'.
wa_order_cfgs_refinst-inst_id = '1'.
APPEND wa_order_cfgs_refinst TO gt_order_cfgs_refinst.
Regards,
RajeshHi all,
Please help me in solving the issue.
Rajesh -
How to Create Fixed Bom using BAPI
Hi all,
Iam using the BAPI "BAPI_BOM_UPLOAD_SAVE" for creation of Fixed BOM of Materials.
I don't know how that is used,I mean i don't know the inputs,
Pls can any one Provide me TEST DATA for this Bapi.
or a sample Program how fixed bom is created.and how can we know thet bom has been created.
for e.g if we create super bom ,the Bom links are stored in cs41,so we are able to know super bom has been created but how to check for fixed bom.is that the same for fixed also.
i have some inputs and with that inputs ,BOM is not being created and the BAPI return table type was E.Hi,
The FM BAPI_BOM_UPLOAD_SAVE is using CSAP_MAT_BOM_CREATE to create the BOM but it does not have any option to specify the alternative to be created.Look for some other FM if you need to create an alternative BOM.Check if the FM BAPI_MATERIAL_BOM_GROUP_CREATE can be used as an alternative
also check this FM.
CS_BI_BOM_CREATE_BATCH_INPUT1 - Create a new BOM or New Alt. BOM.
CS_BC_BOM_CHANGE_BATCH_INPUT - Maintain the BOM.
<b>Reward points</b>
Regards -
How to create purchase reqisation using BAPI....?
Hi Guru's,
i have 100 purchase reqisation details in CSV file ..
could you please any one of you ..which BAPI i have to use to create the purchase reqisation's..
please porvide any program logic realated to this that would be helpfull to me..if you have...:)
please let me know if my question is not clear..
please let me know if any alternative process for this....
thanks in advance and will give full points..
Srinivas...Hi Srinivas,
You have standard BAPI to create the Purchase Requisitions in SAP. You can use this BAPI BAPI_REQUISITION_CREATE to upload all your Purchase requistions.
Thanks,
Mahesh. -
How to create Service Order using bapi BAPI_ALM_ORDER_MAINTAIN
Hi,
I want to create the Service Order with multiple Operations & Components.
I am using this bapi BAPI_ALM_ORDER_MAINTAIN.
But this BAPI creates the service order with only one Operation at a time. Can multiple operations be created using this bapi.
If not could any one please guide to use this or other BAPI to create Service Order with multiple Operations & Components?
Thank's in advance,
ChetanRead the Documentation of the BAPI.
Operations and Components are table parameters, you can pass multiple data. did you check that.... -
How to create Framework Order using BAPI
Hello,
Can someone tell me which BAPI to use to create framework order? thnxHello,
Can someone tell me which BAPI to use to create framework order? thnx -
How to Create Rate Routing Using BAPI
Hello Experts,
I am in SAP ECC 6.0
We are using Repetitive Manufacturing scenario for PP implementation. For that i need to Create Rate Routing.I tried with BAPI_ROUTING_CREATE
but it is Creating simple routing.Please help.It is pretty <removed by moderator>.
Message was edited by: Manish KumarHello Experts,
Please help me on this.As i already tried many stuffs but can't get proper solution. -
How to create multiple pages using flex application.
Hi all,
i am doing flex application which contains 5 different
pages,
to do this i have used viewstack component to navigate
between the pages.
this is working fine if all my pages are of same size. each
page as different background image.
but i have to create pages with different sizes.
my first and second page are small and remaining pages are
big.
when i navigate to 3rd or 4th page, it is showing scrollbar
inside swf.
but i want scrollbar for browser window not inside my swf
anyone please guide me how to create pages in flex
application.
i have one more doubt, if my page contains some html links ,
how to open those links,
is it posible to open the link in new window.
please help me , i have no idea how to create web
applications using flex
Thanks in advance
regards
avanthikaHi inlineblue,
Thanks for your reply,
you asked about sample code,
following is my sample code.
In my Application mxml file, i am loading all custom
components for each page.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*"
horizontalAlign="center" verticalAlign="top"
styleName="plain"
backgroundColor="#FFFFFF"
creationComplete="init()" width="780" height="594" >
<mx:Script>
<![CDATA[
//navigating to next page
public function showNextStep(newIndx:int):void{
vs.selectedIndex=newIndx;
//navigating to previous page
public function showPreviousStep(newIndx):void{
vs.selectedIndex=newIndx
]]>
</mx:Script>
<mx:ViewStack id="vs" paddingLeft="0" height="100%"
width="100%" >
<mx:Canvas id="s1" label="step1"
backgroundImage="assets/Step1.jpg" >
<!-- Step1.jpg image size is width=778, height=560 -->
<mx:HBox paddingLeft="8" width="780" height="548">
</mx:HBox>
<mx:Button alpha="0" buttonMode="true" x="697" y="18"
click="showNextStep(1)" width="72" height="24" />
<mx:Button alpha="0" buttonMode="true" x="697" y="508"
width="72" click="showNextStep(1)" height="24"/>
</mx:Canvas>
<step2 id="s2" label="Step2" hideEffect="{blurImage}"
showEffect="{unblurImage}" />
<step3 id="s3" label="Step3" hideEffect="{blurImage}"
showEffect="{unblurImage}" />
<step4 id="s4" label="Step4" hideEffect="{blurImage}"
showEffect="{unblurImage}" />
<step5 id="s5" label="Step5" hideEffect="{blurImage}"
showEffect="{unblurImage}" />
</mx:ViewStack>
</mx:Application>
// following is the page2 (step2) component code
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()"
backgroundImage="assets/Step2.jpg" width="778" height="600"
>
<!-- Step2.jpg image size is width=778, height=600 -->
<mx:HBox horizontalAlign="left" paddingLeft="5"
height="511" width="768">
</mx:HBox>
<mx:Button alpha="0" buttonMode="true" x="648" y="6"
click="this.parentApplication.showPreviousStep(0)" width="61"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="711" y="6"
click="this.parentApplication.showNextStep(2)" width="53"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="651" y="529"
width="58" click="this.parentApplication.showPreviousStep(0)"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="712" y="528"
width="54" click="this.parentApplication.showNextStep(2)"
height="24"/>
</mx:Canvas>
// following is the code for page3 (step3) component
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()"
backgroundImage="assets/Step3.jpg" >
<!-- Step3.jpg image size is width=778, height=660 -->
<mx:VBox width="763" height="668">
</mx:VBox>
<mx:Button alpha="0" buttonMode="true" x="644" y="10"
click="this.parentApplication.showPreviousStep(1)" width="61"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="708" y="10"
click="this.parentApplication.showNextStep(3)" width="53"
height="24"/>
<mx:Button alpha="0" buttonMode="true" label="Back"
x="625" y="590" width="58"
click="this.parentApplication.showPreviousStep(1)" height="24"/>
<mx:Button alpha="0" buttonMode="true" x="694" y="590"
width="68" click="this.parentApplication.showNextStep(3)"
height="24"/>
</mx:Canvas>
// following is code for page4 (step 4),
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()"
backgroundImage="assets/Step4.jpg" >
<!-- Step4.jpg image size is width=778, height=773 -->
<mx:VBox width="762" height="792">
<!-- User interface -->
</mx:VBox>
<mx:Button alpha="0" buttonMode="true" x="644" y="15"
click="this.parentApplication.showPreviousStep(2)" width="61"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="708" y="16"
click="this.parentApplication.showNextStep(4)" width="53"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="644" y="710"
width="58" click="this.parentApplication.showPreviousStep(2)"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="703" y="710"
width="54" click="this.parentApplication.showNextStep(4)"
height="24"/>
</mx:Canvas>
// Following is code for Page 5 (step 5 ) component.
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()"
backgroundImage="assets/Step5.jpg" width="778"
height="600">
<!-- Step5.jpg image size is width=778, height=539-->
<mx:VBox paddingLeft="170" paddingTop="170" width="778"
height="522">
</mx:VBox>
<mx:Button alpha="0" buttonMode="true" x="654" y="41"
click="this.parentApplication.showPreviousStep(3)" width="72"
height="24"/>
<mx:Button alpha="0" buttonMode="true" x="654" y="486"
width="72" click="this.parentApplication.showPreviousStep(3)"
height="24"/>
</mx:Canvas>
I am getting vertical scrollbar for page3 and page4,
please tell me how to avoid this, Is their any other method
to do this.
Following is the link for my above code
http://www.emantras.com/flexdemo/sample.html
in this application one more problem is also their,
background image loads very slow, before it loads all the flex
components will load. So when you open this please wait till
background image loaded, to move to next and back pages.
Thanks for your time and consideration.
Regards
Avanthika -
How to write a application using WDJ with the adobe form ?
Hi, experts,
I don't know how to write a application using !!webdynpro for java!! with the adobe form so that I can fill data to the adobe form and get data from the adobe form.
Note: I have configed the ADS(adobe document services),and I can create a application with a interactiveform in webdynpro for abap and run it successfully, so that I can fill data to the adobe form and get data from the adobe form.
Do you give me some hint?
Thanks a lot.
Best regards,
tao
Edited by: wang tao on Sep 9, 2008 8:59 AMHi,
Refers the following links.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c9a954-aa20-2a10-64bb-ea0835204e03
Thanks
Abhilasha. -
How to create purchase order using VA01 for BAPI?
how to create purchase order using VA01 for BAPI?
Hi Arun,
Please check this link
Example Program for BAPI_PO_CREATE1
Re: BAPI_PO_CREATE1
Questions in BAPI_PO_CREATE1
Problem with BAPI_PO_CREATE1
*& Report BAPI_PO_CREATE *
REPORT bapi_po_create.
Input File Declaration
TYPES: BEGIN OF ty_input_file,
column1 TYPE char50,
column2 TYPE char50,
column3 TYPE char50,
column4 TYPE char50,
column5 TYPE char50,
column6 TYPE char50,
column7 TYPE char50,
column8 TYPE char50,
column9 TYPE char50,
column10 TYPE char50,
column11 TYPE char50,
column12 TYPE char50,
column13 TYPE char50,
column14 TYPE char50,
column15 TYPE char50,
column16 TYPE char50,
column17 TYPE char50,
column18 TYPE char50,
END OF ty_input_file.
DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
wa_input_file TYPE ty_input_file.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',.,..',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
Read presentation server file
PERFORM f1003_upload_file.
IF NOT i_input_file[] IS INITIAL.
PERFORM split_data.
ENDIF.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
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. " f4_presentation_file
*& Form f1003_upload_file
*& Upload File
FORM f1003_upload_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_input_file
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. " f1003_upload_file
*& Form split_data
Collect data for creating Purchase Order
FORM split_data .
DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
i_services TYPE STANDARD TABLE OF bapiesllc ,
i_srvacc TYPE STANDARD TABLE OF bapiesklc,
i_return TYPE STANDARD TABLE OF bapiret2,
wa_header TYPE bapimepoheader,
wa_headerx TYPE bapimepoheaderx,
wa_poitem TYPE bapimepoitem,
wa_poitemx TYPE bapimepoitemx,
wa_poitem_sch TYPE bapimeposchedule,
wa_poitem_schx TYPE bapimeposchedulx,
wa_acct_*** TYPE bapimepoaccount,
wa_acct_assx TYPE bapimepoaccountx,
wa_services TYPE bapiesllc,
wa_srvacc TYPE bapiesklc,
wa_return TYPE bapiret2,
ws_po TYPE bapimepoheader-po_number.
break gbpra8.
wa_services-pckg_no = 10.
wa_services-line_no = 1.
wa_services-outl_no = '0'.
wa_services-outl_ind = c_x.
wa_services-subpckg_no = 20.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 10.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 01.
wa_srvacc-serial_no = 01.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
LOOP AT i_input_file INTO wa_input_file.
IF wa_input_file-column2 EQ 'HD'.
wa_header-doc_type = wa_input_file-column3.
wa_header-creat_date = sy-datum.
wa_header-created_by = sy-uname.
wa_header-vendor = wa_input_file-column4.
PERFORM conversion_output USING wa_header-vendor
CHANGING wa_header-vendor.
wa_header-comp_code = 'DE03'.
wa_header-purch_org = 'DE03'.
wa_header-pur_group = 'DE1'.
wa_header-vper_start = wa_input_file-column9.
wa_header-vper_end = wa_input_file-column10.
wa_headerx-comp_code = c_x.
wa_headerx-doc_type = c_x.
wa_headerx-creat_date = c_x.
wa_headerx-created_by = c_x.
wa_headerx-vendor = c_x.
wa_headerx-purch_org = c_x.
wa_headerx-pur_group = c_x.
wa_headerx-vper_start = c_x.
wa_headerx-vper_end = c_x.
ENDIF.
IF wa_input_file-column2 EQ 'IT'.
wa_poitem-po_item = wa_input_file-column3.
wa_poitem-short_text = wa_input_file-column6.
wa_poitem-plant = wa_input_file-column8.
wa_poitem-quantity = '1'.
wa_poitem-tax_code = 'V0'.
wa_poitem-item_cat = 'D'.
wa_poitem-acctasscat = 'K'.
wa_poitem-matl_group = wa_input_file-column7.
wa_poitem-pckg_no = '10'.
APPEND wa_poitem TO i_poitem .
wa_poitemx-po_item = wa_input_file-column3.
wa_poitemx-po_itemx = c_x.
wa_poitemx-short_text = c_x.
wa_poitemx-plant = c_x.
wa_poitemx-quantity = c_x.
wa_poitemx-tax_code = c_x.
wa_poitemx-item_cat = c_x.
wa_poitemx-acctasscat = c_x.
wa_poitemx-matl_group = c_x.
wa_poitemx-pckg_no = c_x.
APPEND wa_poitemx TO i_poitemx.
wa_poitem_sch-po_item = wa_input_file-column3.
wa_poitem_sch-delivery_date = sy-datum.
APPEND wa_poitem_sch TO i_poitem_sch.
wa_poitem_schx-po_item = wa_input_file-column3.
wa_poitem_schx-po_itemx = c_x.
wa_poitem_schx-delivery_date = c_x.
APPEND wa_poitem_schx TO i_poitem_schx.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 01.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 02.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 01.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 02.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_services-pckg_no = 20.
wa_services-line_no = 2.
wa_services-service = wa_input_file-column9.
wa_services-quantity = '100'.
wa_services-gr_price = '100'.
wa_services-userf1_txt = wa_input_file-column13.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 20.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 02.
wa_srvacc-serial_no = 02.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
ENDIF.
ENDLOOP.
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 = ws_po
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = i_return
poitem = i_poitem
poitemx = i_poitemx
POADDRDELIVERY =
poschedule = i_poitem_sch
poschedulex = i_poitem_schx
poaccount = i_acct_***
POACCOUNTPROFITSEGMENT =
poaccountx = i_acct_assx
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
poservices = i_services
posrvaccessvalues = i_srvacc
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
break gbpra8.
LOOP AT i_return INTO wa_return.
ENDLOOP.
ENDFORM. " split_data
*& Form conversion_output
Conversion exit input
FORM conversion_output USING p_ip
CHANGING p_op.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_ip
IMPORTING
output = p_op.
ENDFORM. " conversion_output
Best regards,
raam -
How can i create slaes order using BAPI
hi all,
i didnt work on BAPIS .how can i create sales order using BAPI here i should pass Z values.
Moderator message : FAQ, search for available information. Thread locked.
Edited by: Vinod Kumar on Sep 13, 2011 12:22 PMHi!
There are a lot of answered threads regarding your question. Try searching first. Below is a sample link.
BAPI_SALESORDER_CREATEFROMDAT2
Regards,
Steph
Edited by: stephquion on Sep 13, 2011 8:25 AM
Maybe you are looking for
-
My Ipod Classic is not recognized by my PC but is recognized on my laptop.
Hardware: Ipod Classic 32 Software: Windows XP Pro, Service Pack 3 Issue: If I plug the ipod to any USB on the pc I get a notice that says "USB device not recognized"- If I go to the drivers and uninstall, and then reset, it will recognize the unit-
-
Hi, I'm trying to write a simple application that does nothing more than write a file to disk with the date and time every second. (It's only a test application). The important thing is that while it is not actually writing the file it should not tak
-
Hi, I have 4 years of experience in SAP MM and recently submitted my CV to SAP India for evaluation and they are confirming that i am eligible for "Associate Level" direct certification. After knowing that there are Professional and Master level cert
-
Best Pen for taking notes on the twist
Hi, I'm curious at what pen can be best used for taking notes on my Twist. When I use OneNote it won't let me use my finger or the rubber tipped stylus to write with, but instead requires the use of the keyboard, very annoying when in class. I've b
-
Feature Request: Access to Pathfinder functions from JS
It would be incredibly helpful to have access to the pathfinder from the JS API. These functions are pretty complex and rewriting them would surely result in slight implementation differences.