*&---------------------------------------------------------------------*
*& Report ZVVF_MR025_WEIGHBRIDGE_FILE_SD
*&---------------------------------------------------------------------*
REPORT ZVVF_MR025_WEIGHBRIDGE_FILE_SD no standard page heading
line-size 110 MESSAGE-ID ZMM .
*----------------------------------------------------------------------
** Module Sales *
*----------------------------------------------------------------------
** Objective: Weighbridge Interface-Batch Quantity Updation
** Program : Updates tables (X) Download data ( )
** Output Lists (X) ALV
**
**---------------------------------------------------------------------*
* External Dependencies
**---------------------------------------------------------------------*
*
**---------------------------------------------------------------------*
* Amendment History
**---------------------------------------------------------------------*
* Who Change ID Reason
*** ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*---------------------------------------------------------------------**
* Type-pools
*----------------------------------------------------------------------*
TYPE-POOLS : slis.
*---------------------------------------------------------------------*
**TABLES :
*---------------------------------------------------------------------*
TABLES : ZVVF_MT25_OUTMOV, " Weigh Bridge Down Loaded Details
lips, "SD document: Delivery: Item data
T100.
*---------------------------------------------------------------------*
**CONSTANTS :
*---------------------------------------------------------------------*
*--- For ALV ----*
CONSTANTS: c_top_of_page_db TYPE slis_formname VALUE 'TOP_OF_PAGE_DB',
c_tcode TYPE sy-tcode VALUE 'ZMR025_POST2'.
*---------------------------------------------------------------------*
**TYPES :
*---------------------------------------------------------------------*
DATA : BEGIN OF TY_DETAIL,
PO_NUMBER TYPE BAPI2017_GM_ITEM_CREATE-PO_NUMBER,
PO_ITEM TYPE BAPI2017_GM_ITEM_CREATE-PO_ITEM,
MATERIAL TYPE BAPI2017_GM_ITEM_CREATE-MATERIAL,
VENDOR TYPE BAPI2017_GM_ITEM_CREATE-VENDOR,
PLANT TYPE BAPI2017_GM_ITEM_CREATE-PLANT,
STGE_LOC TYPE BAPI2017_GM_ITEM_CREATE-STGE_LOC,
MOVE_TYPE TYPE BAPI2017_GM_ITEM_CREATE-MOVE_TYPE,
ENTRY_QNT TYPE BAPI2017_GM_ITEM_CREATE-ENTRY_QNT,
ENTRY_UOM TYPE BAPI2017_GM_ITEM_CREATE-ENTRY_UOM,
ENTRY_UOM_ISO TYPE BAPI2017_GM_ITEM_CREATE-ENTRY_UOM_ISO,
MVT_IND TYPE BAPI2017_GM_ITEM_CREATE-MVT_IND,
ITEM_TEXT TYPE BAPI2017_GM_ITEM_CREATE-ITEM_TEXT,
VENDRBATCH TYPE BAPI2017_GM_ITEM_CREATE-VENDRBATCH,
ST_UN_QTYY_1 TYPE BAPI2017_GM_ITEM_CREATE-ST_UN_QTYY_1,
QUANTITY TYPE BAPI2017_GM_ITEM_CREATE-QUANTITY,
PO_PR_QNT TYPE BAPI2017_GM_ITEM_CREATE-PO_PR_QNT,
IND_PROPOSE_QUANX TYPE BAPI2017_GM_ITEM_CREATE-IND_PROPOSE_QUANX,
BASE_UOM TYPE BAPI2017_GM_ITEM_CREATE-BASE_UOM.
DATA : END OF TY_DETAIL.
*---------------------------------------------------------------------*
**DATA :
*---------------------------------------------------------------------*
DATA : W_REPID LIKE SY-REPID,
W_ANS type n,
w_ok like sy-ucomm,
W_sgtxt LIKE mseg-sgtxt,
W_input like mseg-matnr.
DATA : W_DATE(10) TYPE C,
W_DD(2) TYPE C,
W_MM(2) TYPE C,
W_YY(4) TYPE C,
W_RATE(16) TYPE C,
w_lines(2) type n.
DATA: W_MSTRING(480).
*---------------------------------------------------------------------*
**INTERNAL TABLES :
*---------------------------------------------------------------------*
*--- For ALV ----*
DATA: it_list_top_of_page TYPE slis_t_listheader,
it_events TYPE slis_t_event,
it_fieldcat TYPE slis_t_fieldcat_alv.
*---------------*
DATA: IT_PODAT TYPE TABLE OF ZVVF_MT25_OUTMOV WITH HEADER LINE,
IT_PODAT1 TYPE TABLE OF ZVVF_MT25_OUTMOV WITH HEADER LINE,
IT_PODAT2 TYPE TABLE OF ZVVF_MT25_OUTMOV WITH HEADER LINE..
DATA : IT_DETAIL LIKE STANDARD TABLE OF TY_DETAIL WITH HEADER LINE.
data : it_header type table of BAPIOBDLVHDRCHG WITH HEADER LINE,
it_item type table of BAPIOBDLVITEMCHG WITH HEADER LINE,
it_control type table of BAPIOBDLVHDRCTRLCHG WITH HEADER LINE,
ITABRES type table of BAPIRET2 WITH HEADER LINE,
it_item_cnt type table of BAPIOBDLVITEMCTRLCHG WITH HEADER LINE .
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: IT_MSG TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
DATA: IT_MSG1 TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
DATA : BEGIN OF IT_SUM OCCURS 0,
VBELN LIKE LIPS-VBELN,
WERKS LIKE LIPS-WERKS,
ZLFIMG LIKE LIPS-LFIMG,
END OF IT_SUM.
*---------------------------------------------------------------------*
**WORK AREAS
*---------------------------------------------------------------------*
DATA: WA_PODAT LIKE LINE OF IT_PODAT,
WA_PODAT1 LIKE LINE OF IT_PODAT1,
WA_layout TYPE slis_layout_alv, " For ALV
WA_SUM LIKE LINE OF IT_SUM.
*---------------------------------------------------------------------*
**SELECTION SCREEN
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
**INITIALIZATION :
*---------------------------------------------------------------------*
INITIALIZATION.
w_repid = SY-REPID.
*---------------------------------------------------------------------*
**AT SELECTION SCREEN :
*---------------------------------------------------------------------*
AT SELECTION-SCREEN.
*---------------------------------------------------------------------*
**START OF SELECTION :
*---------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM Check_DATA.
W_DD = SY-DATUM+6(2).
W_MM = SY-DATUM+4(2).
W_YY = SY-DATUM+0(4).
***convert date to appropriate format
CONCATENATE W_DD W_MM W_YY INTO W_DATE .
LOOP AT IT_PODAT1 INTO WA_PODAT1.
WA_SUM-VBELN = WA_PODAT1-VBELN.
WA_SUM-WERKS = WA_PODAT1-WERKS.
WA_SUM-ZLFIMG = WA_PODAT1-ZLFIMG.
COLLECT WA_SUM INTO IT_SUM.
ENDLOOP.
it_podat[] = it_podat1[].
sort it_podat by vbeln werks.
delete adjacent duplicates from it_podat comparing vbeln werks.
LOOP AT IT_podat INTO WA_podat.
*PERFORM MATNR_FORMAT using WA_podat-lifnr.
READ TABLE IT_SUM INTO WA_SUM WITH KEY VBELN = WA_podat-vbeln
WERKS = WA_podat-WERKS.
IF SY-SUBRC = 0.
WA_podat-ZLFIMG = WA_SUM-ZLFIMG.
ENDIF.
PERFORM MATNR_FORMAT using WA_podat-vbeln.
MODIFY IT_podat FROM WA_podat TRANSPORTING vbeln ZLFIMG.
endloop.
clear w_input.
*---------------------------------------------------------------------*
**END OF SELECTION :
*---------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM fieldcat_init USING it_fieldcat[].
PERFORM eventtab_build USING it_events[].
PERFORM comment_build USING it_list_top_of_page[].
PERFORM layout_build USING WA_layout.
PERFORM write_alv_grid.
*&---------------------------------------------------------------------*
*& Form Check_DATA
*&---------------------------------------------------------------------*
* Check DATA
*----------------------------------------------------------------------*
FORM Check_DATA.
**Select all OBD which not yet posted or downloaded as text file or
**blocked or batch updated
select * from ZVVF_MT25_OUTMOV into corresponding fields of table
it_podat1 where Zpost = 'X' AND
zdown = 'X' and
Zblck = ' ' AND
ZUPDT = ' '.
IF SY-SUBRC NE 0.
MESSAGE E005.
ENDIF.
endform. "Check_DATA
*&--------------------------------------------------------------------*
*& Form fieldcat_init
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->IT_FIELDCATtext
*---------------------------------------------------------------------*
FORM fieldcat_init USING lt_fieldcat TYPE slis_t_fieldcat_alv.
DATA : wa_fieldcat TYPE slis_fieldcat_alv.
DATA :w_pos TYPE i VALUE 0.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'ZUPDT'.
wa_fieldcat-seltext_m = 'Update Batch Qty' .
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '1'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-EDIT = 'X'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_m = 'Delivery No'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-seltext_m = 'Plant'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'GMENGE'.
wa_fieldcat-seltext_m = 'Gross Wt.'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'TMENGE'.
wa_fieldcat-seltext_m = 'Tare Wt.'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'ZLFIMG'.
wa_fieldcat-seltext_m = 'Net Wt.'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'LFIMG'.
wa_fieldcat-seltext_m = 'Outbond Delivery Qty'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
w_pos = w_pos + 1.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = w_pos.
wa_fieldcat-tabname = 'IT_PODAT'.
wa_fieldcat-fieldname = 'ZSLIPNO'.
wa_fieldcat-seltext_m = 'Weighslip No.'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO lt_fieldcat.
ENDFORM. " fieldcat_init
*&---------------------------------------------------------------------*
*& Form eventtab_build
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_it_EVENTS[] text
*----------------------------------------------------------------------*
FORM eventtab_build USING lt_events TYPE slis_t_event.
DATA: wa_event TYPE slis_alv_event.
DATA: c_top_of_page TYPE slis_formname.
c_top_of_page = c_top_of_page_db.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
INTO wa_event.
IF sy-subrc <> 0.
MOVE c_top_of_page TO wa_event-form.
APPEND wa_event TO lt_events.
ELSE.
MOVE c_top_of_page TO wa_event-form.
MODIFY lt_events FROM wa_event INDEX sy-tabix .
ENDIF.
ENDFORM. " eventtab_build
*&---------------------------------------------------------------------*
*& Form comment_build
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_it_LIST_TOP_OF_PAGE[] text
*----------------------------------------------------------------------*
FORM comment_build USING lt_top_of_page TYPE slis_t_listheader.
DATA: wa_line TYPE slis_listheader.
CLEAR wa_line.
wa_line-typ = 'H'.
wa_line-info = 'VVF LTD. Mumbai'.
APPEND wa_line TO lt_top_of_page.
wa_line-typ = 'H'.
wa_line-info = SY-ULINE.
APPEND wa_line TO lt_top_of_page.
wa_line-typ = 'H'.
wa_line-info = 'Batch Qty Updation'.
APPEND wa_line TO lt_top_of_page.
ENDFORM. " comment_build
*&---------------------------------------------------------------------*
*& Form layout_build
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_WA_layout text
*----------------------------------------------------------------------*
FORM layout_build USING wa_layout TYPE slis_layout_alv.
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-no_totalline = 'X'.
* wa_layout-edit = 'X'.
ENDFORM. " layout_build
*&---------------------------------------------------------------------*
*& Form write_alv_grid
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM write_alv_grid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_PF_STATUS_SET = 'PF_STATUS'
i_background_id = 'ALV_BACKGROUND'
I_CALLBACK_TOP_OF_PAGE = c_top_of_page_db
is_layout = WA_layout
it_fieldcat = it_fieldcat[]
it_events = it_events[]
i_save = 'A'
TABLES
t_outtab = IT_PODAT
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. " write_alv_grid
*&---------------------------------------------------------------------*
*& Form PF_STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM PF_STATUS using extab type slis_t_extab.
SET PF-STATUS 'ZSTANDARD1'.
ENDFORM. "PF_STATUS
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM USER_COMMAND using OK_CODE type SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
IF OK_CODE = '&DATA_SAVE'.
**
EXPORT IT_PODAT TO MEMORY ID 'ZVV8'.
CALL TRANSACTION c_tcode .
leave program.
*perform update_qty.
**
***when BACK leave screen
ELSEIF OK_CODE = 'OUT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = text-003
TEXT_QUESTION = text-004
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = ' '
IMPORTING
ANSWER = w_ans
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
IF w_ans = '1'.
set screen 0.
leave screen.
ELSE.
leave screen.
ENDIF.
endif.
ENDFORM. "USER_COMMAND
*---------------------------------------------------------------------*
* FORM TOP_OF_PAGE_DB *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM TOP_OF_PAGE_DB.
*
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_list_top_of_page
i_logo = ' '.
ENDFORM. "top_of_page_db
*&--------------------------------------------------------------------*
*& Form MATNR_FORMAT
*&--------------------------------------------------------------------*
* MATNR FORMAT
*---------------------------------------------------------------------*
FORM MATNR_FORMAT using w_input.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = W_input
IMPORTING
OUTPUT = w_input.
ENDFORM.
*&--------------------------------------------------------------------*
*& Form update_qty
*&--------------------------------------------------------------------*
* update batch qty
*---------------------------------------------------------------------*
*form update_qty.
*
*loop at it_podat into wa_podat where zupdt = 'X'.
*PERFORM MATNR_FORMAT_INPUT using wa_podat-vbeln.
* W_RATE = wa_podat-zlfimg.
*if wa_podat-lfimg ne wa_podat-zlfimg.
*perform delete_order.
*perform update_order.
* WRITE: / Text-001 COLOR COL_HEADING,
* 15 Text-002 COLOR COL_HEADING.
*
* WRITE: / wa_podat-vbeln COLOR COL_NORMAL,
* 15 wa_podat-werks COLOR COL_NORMAL.
* skip.
* LOOP AT IT_MSG.
* SELECT SINGLE * FROM T100 WHERE SPRSL = IT_MSG-MSGSPRA
* AND ARBGB = IT_MSG-MSGID
* AND MSGNR = IT_MSG-MSGNR.
* IF SY-SUBRC = 0.
*
* PERFORM SAVE_MEMO.
* W_MSTRING = T100-TEXT.
* IF W_MSTRING CS '&1'.
* REPLACE '&1' WITH IT_MSG-MSGV1 INTO W_MSTRING.
* REPLACE '&2' WITH IT_MSG-MSGV2 INTO W_MSTRING.
* REPLACE '&3' WITH IT_MSG-MSGV3 INTO W_MSTRING.
* REPLACE '&4' WITH IT_MSG-MSGV4 INTO W_MSTRING.
* ELSE.
* REPLACE '&' WITH IT_MSG-MSGV1 INTO W_MSTRING.
* REPLACE '&' WITH IT_MSG-MSGV2 INTO W_MSTRING.
* REPLACE '&' WITH IT_MSG-MSGV3 INTO W_MSTRING.
* REPLACE '&' WITH IT_MSG-MSGV4 INTO W_MSTRING.
* ENDIF.
*
* CONDENSE W_MSTRING.
* IF IT_MSG-MSGTYP = 'S'.
* WRITE: / IT_MSG-MSGTYP COLOR COL_POSITIVE,
* W_MSTRING(250) COLOR COL_POSITIVE.
* ELSEIF IT_MSG-MSGTYP = 'E'.
* WRITE: / IT_MSG-MSGTYP COLOR COL_NEGATIVE,
* W_MSTRING(250) COLOR COL_NEGATIVE.
* ELSEIF IT_MSG-MSGTYP = 'W'.
* WRITE: / IT_MSG-MSGTYP COLOR COL_TOTAL ,
* W_MSTRING(250) COLOR COL_TOTAL.
* ENDIF.
* ELSE.
* WRITE: / IT_MSG COLOR COL_NEGATIVE.
*
* ENDIF.
* ENDLOOP.
* write : sy-uline(95).
* CLEAR : IT_MSG.
* REFRESH : IT_MSG.
*
*endif.
*endloop.
*endform.
*
*
*FORM SAVE_MEMO.
*
*IF IT_MSG-MSGTYP = 'S'
*and IT_MSG-MSGID = 'VL' AND IT_MSG-MSGNR = '311'.
*
* UPDATE ZVVF_MT25_OUTMOV SET zupdt = 'X'
* where vbeln = wa_podat-vbeln and
* werks = wa_podat-werks .
* ENDIF.
*endform.
*&--------------------------------------------------------------------*
*& Form MATNR_FORMAT_INPUT
*&--------------------------------------------------------------------*
* MATNR FORMAT INPUT
*---------------------------------------------------------------------*
FORM MATNR_FORMAT_INPUT using w_input.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = w_input
IMPORTING
OUTPUT = w_input.
ENDFORM.
*&--------------------------------------------------------------------*
*& Form delete_order
*&--------------------------------------------------------------------*
form delete_order.
perform bdc_dynpro using 'SAPMV50A' '4004'.
perform bdc_field using 'BDC_CURSOR'
'LIKP-VBELN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LIKP-VBELN'
wa_podat-vbeln.
perform bdc_dynpro using 'SAPMV50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=CHSP_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-POSNR(01)'.
perform bdc_field using 'RV50A-LIPS_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPMV50A' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=POLO_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-POSNR(03)'.
perform bdc_field using 'RV50A-LIPS_SELKZ(01)'
'X'.
perform bdc_field using 'RV50A-LIPS_SELKZ(02)'
'X'.
perform bdc_field using 'RV50A-LIPS_SELKZ(03)'
'X'.
perform bdc_field using 'RV50A-LIPS_SELKZ(04)'
'X'.
perform bdc_field using 'RV50A-LIPS_SELKZ(05)'
'X'.
perform bdc_dynpro using 'SAPMV50A' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=SICH_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-CHARG(01)'.
call transaction 'VL02N' using BDCDATA mode 'E' update 'S'
MESSAGES INTO IT_MSG.
IT_MSG1[] = IT_MSG[].
REFRESH : IT_MSG,BDCDATA.
CLEAR : IT_MSG,BDCDATA.
ENDFORM.
*&--------------------------------------------------------------------*
*& Form update_order
*&--------------------------------------------------------------------*
form update_order.
perform bdc_dynpro using 'SAPMV50A' '4004'.
perform bdc_field using 'BDC_CURSOR'
'LIKP-VBELN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LIKP-VBELN'
wa_podat-vbeln.
perform bdc_dynpro using 'SAPMV50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'LIPSD-G_LFIMG(01)'.
perform bdc_field using 'LIPSD-G_LFIMG(01)'
W_RATE.
perform bdc_dynpro using 'SAPMV50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=CHSP_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-POSNR(01)'.
perform bdc_field using 'RV50A-LIPS_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPMV50A' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=CHFD_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-CHARG(01)'.
perform bdc_dynpro using 'SAPMV50A' '3000'.
*************************
*perform bdc_field using 'BDC_OKCODE'
* '=HTEX_T'.
*perform bdc_field using 'BDC_CURSOR'
* 'LIPS-CHARG(02)'.
*perform bdc_dynpro using 'SAPMV50A' '2000'.
*perform bdc_field using 'BDC_OKCODE'
* '=%_GC 108 22'.
*perform bdc_field using 'LV70T-SPRAS'
* 'EN'.
*perform bdc_dynpro using 'SAPMV50A' '2000'.
*perform bdc_field using 'BDC_OKCODE'
* '=%_GC 108 22'.
*perform bdc_field using 'LV70T-SPRAS'
* 'EN'.
*perform bdc_dynpro using 'SAPMV50A' '2000'.
*perform bdc_field using 'BDC_OKCODE'
* '=SICH_T'.
*perform bdc_field using 'LV70T-SPRAS'
* 'EN'.
*************************
perform bdc_field using 'BDC_OKCODE'
'=SICH_T'.
perform bdc_field using 'BDC_CURSOR'
'LIPS-CHARG(04)'.
call transaction 'VL02N' using BDCDATA mode 'E' update 'S'
MESSAGES INTO IT_MSG.
APPEND LINES OF IT_MSG1 TO IT_MSG.
ENDFORM.
*&--------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->PROGRAM text
* -->DYNPRO text
*---------------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
*----------------------------------------------------------------------
*
* FORM : Insert field
*
*----------------------------------------------------------------------
*
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> ''.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD
No comments:
Post a Comment