Zcqp01 Programe
Zcqp01 Programe
Zcqp01 Programe
SELECTION-SCREEN : SKIP.
SELECTION-SCREEN : END OF BLOCK B1.
PERFORM F4_FILENAME.
START-OF-SELECTION.
PERFORM UPLOAD_EXCELDATA_ITAB.
PERFORM BAPI_DATA.
* PERFORM display_log_list.
*&---------------------------------------------------------------------*
*& Form F4_FILENAME
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM F4_FILENAME .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FNAME'
IMPORTING
FILE_NAME = P_FNAME.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form UPLOAD_EXCELDATA_ITAB
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM UPLOAD_EXCELDATA_ITAB .
IF IT_XL_DAT[] IS INITIAL.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE : / 'No Data Uploaded'(002).
EXIT.
ELSE.
LOOP AT IT_XL_DAT INTO WA_XL_DAT .
IF WA_XL_DAT-ROW EQ WA_ROW.
ENDIF.
ENDLOOP.
ENDIF.
SELECT MKMNR
KURZTEXT FROM QPMT
INTO TABLE IT_QPMT FOR ALL ENTRIES IN IT_TAB
WHERE ZAEHLER = IT_TAB-WERKS AND MKMNR = IT_TAB-VERWMERKM AND SPRACHE =
'E' .
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form BAPI_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM BAPI_DATA .
AT NEW MATNR.
APPEND IT_MATERIAL.
IT_TASK-GROUP_COUNTER = WA_TAB-GC .
IT_TASK-VALID_FROM = LV_DATE .
IT_TASK-TASK_LIST_USAGE = WA_TAB-USAGE .
IT_TASK-PLANT = WA_TAB-WERKS.
IT_TASK-TASK_LIST_STATUS = WA_TAB-STATUS .
IT_TASK-TASK_MEASURE_UNIT = lv_uom ." WA_TAB-UOM . .
IT_TASK-LOT_SIZE_FROM = WA_TAB-LOTSZ .
IT_TASK-LOT_SIZE_TO = WA_TAB-LOTSI .
IT_TASK-DESCRIPTION = WA_TAB-ROTXT.
APPEND IT_TASK.
IT_OPERATION-GROUP_COUNTER = WA_TAB-GC .
IT_OPERATION-VALID_FROM = LV_DATE .
IT_OPERATION-ACTIVITY = WA_TAB-OPID .
IT_OPERATION-OPERATION_ID = WA_TAB-OPID .
IT_OPERATION-CONTROL_KEY = WA_TAB-STEUS_01 .
* it_operation-obj_id = .
IT_OPERATION-WORK_CNTR = WA_TAB-WRKCN .
IT_OPERATION-PLANT = WA_TAB-WERKS .
IT_OPERATION-DESCRIPTION = WA_TAB-OPDES.
IT_OPERATION-OPERATION_MEASURE_UNIT = lv_uom ." WA_TAB-UOM .
IT_OPERATION-DENOMINATOR = '1'.
IT_OPERATION-NOMINATOR = '1' .
IT_OPERATION-BASE_QUANTITY = WA_TAB-QTY .
APPEND IT_OPERATION.
ENDAT .
IT_INSP_CHAR-GROUP_COUNTER = WA_TAB-GC.
IT_INSP_CHAR-OPERATION_ID = WA_TAB-OPID .
IT_INSP_CHAR-ACTIVITY = WA_TAB-OPID.
IT_INSP_CHAR-INSPCHAR = WA_TAB-CHRNO. .
IT_INSP_CHAR-VALID_FROM = LV_DATE .
IT_INSP_CHAR-MSTR_CHAR = WA_TAB-VERWMERKM .
IT_INSP_CHAR-PMSTR_CHAR = WA_TAB-WERKS .
IT_INSP_CHAR-CHA_MASTER_IMPORT_MODUS = 'C' .
READ TABLE IT_QPMT INTO WA_QPMT WITH KEY MKMNR = WA_TAB-VERWMERKM BINARY
SEARCH.
IF SY-SUBRC IS INITIAL .
IT_INSP_CHAR-CHAR_DESCR = WA_QPMT-KURZTEXT. .
ENDIF.
CLEAR: WA_QPMT.
ENDIF .
IT_INSP_CHAR-SMPL_PROCEDURE = WA_TAB-STICHPRVER .
IT_INSP_CHAR-SMPL_UNIT = lv_uom ." WA_TAB-UOM.
IT_INSP_CHAR-SMPL_QUANT = WA_TAB-QTY.
APPEND IT_INSP_CHAR .
AT END OF MATNR .
PERFORM CALL_BAPI_AND_COMMIT .
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form CALL_BAPI_AND_COMMIT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM CALL_BAPI_AND_COMMIT .