Data is not linked to material wise
Hi experts,
In this Report data is not linked to material wise.
it comming merge the all the materials in one material.
TYPE-POOLS: SLIS.
TABLES: MKPF,LFA1,MSEG,EKET,T001L,MAKT,S031,S032,MARA,LIPS,LIKP,T001W.
DATA FLAG TYPE I.
DATA : MENGE_RE LIKE MSEG-MENGE,
MENGE_IS LIKE MSEG-MENGE,
MENGE_O LIKE MSEG-MENGE,
MENGE_BAL LIKE MSEG-MENGE.
DATA MAGBB LIKE S031-MAGBB.
DATA : F_LNO LIKE SY-LINNO,
S_LNO LIKE SY-LINNO,
V_LNO LIKE SY-LINNO.
DATA MZUBB LIKE S031-MZUBB.
DATA V_MONTH LIKE S031-SPMON.
DATA XBLNR LIKE MKPF-XBLNR.
DATA : BEGIN OF ITAB1 OCCURS 100,
MATNR LIKE MAKT-MATNR,
END OF ITAB1.
DATA : BEGIN OF ITAB2 OCCURS 100,
MATNR LIKE MAKT-MATNR,
WERKS LIKE MARD-WERKS,
LGORT LIKE MARD-LGORT,
BUSTW LIKE MSEG-BUSTW,
BWART LIKE MSEG-BWART,
SHKZG LIKE MSEG-SHKZG,
MENGE LIKE MSEG-MENGE,
END OF ITAB2.
DATA: PAGNO(5) TYPE C.
DATA : PAGENO LIKE SY-PAGNO.
DATA: STR1 TYPE DATS,
STR2(14) TYPE C,
STR3(10) TYPE C.
DATA : V_MONUM LIKE T015M-MONUM,
V_MONAM LIKE T015M-MONAM.
DATA : V_PAGENO LIKE SY-PAGNO.
TYPES: FARBE TYPE SLIS_T_SPECIALCOL_ALV.
DATA V_STOCK LIKE MSEG-MENGE.
DATA V_STOCK1 LIKE MSEG-MENGE.
DATA: V_MONTH1 LIKE S031-SPMON.
DATA: OSTOCK LIKE MSEG-MENGE.
DATA : FLAG6 TYPE C,
V_PAGENO1 LIKE SY-PAGNO,
V_PAGENO2 LIKE SY-PAGNO.
DATA: FLD(15).
DATA: TXT(50).
DATA: FLAG5.
I N I T I A L I Z A T I O N
*GT_REPID = SY-REPID.
PAGNO = SY-PAGNO.
A T S E L E C T I O N S C R E E N
AT SELECTION-SCREEN.
*AT SELECTION-SCREEN ON BUDAT.
PERFORM VALIDATION.
S T A R T O F S E L E C T I O N
START-OF-SELECTION.
SET MARGIN 5.
PERFORM FETCH_DATA.
PERFORM WRITE_REPORT.
PERFORM STOCK.
E N D O F S E L E C T I O N
END-OF-SELECTION.
Report Selections
DATA: BEGIN OF IT_HEADER OCCURS 10,
WERKS LIKE MSEG-WERKS,
NAME1 LIKE T001W-NAME1,
MAKTX LIKE MAKT-MAKTX,
MATNR LIKE MSEG-MATNR,
MENGE_O LIKE MSEG-MENGE,
END OF IT_HEADER.
DATA: BEGIN OF ITAB OCCURS 50,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
BWART LIKE MSEG-BWART,
LGORT LIKE MSEG-LGORT,
EBELN LIKE MSEG-EBELN,
XBLNR LIKE MKPF-XBLNR,
BUDAT LIKE MKPF-BUDAT,
MBLNR LIKE MSEG-MBLNR,
MENGE LIKE MSEG-MENGE,
MAKTX LIKE MAKT-MAKTX,
XAUTO LIKE MSEG-XAUTO,
NAME1 LIKE T001W-NAME1,
MENGE_O LIKE MSEG-MENGE,
SHKZG LIKE MSEG-SHKZG,
MENGE_IS LIKE MSEG-MENGE,
MENGE_RE LIKE MSEG-MENGE,
END OF ITAB.
DATA: BEGIN OF INT_DATA OCCURS 50,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
BWART LIKE MSEG-BWART,
XBLNR LIKE MKPF-XBLNR,
MBLNR LIKE MSEG-MBLNR,
BUDAT LIKE MKPF-BUDAT,
MAKTX LIKE MAKT-MAKTX,
MENGE_O LIKE MSEG-MENGE,
MENGE_R LIKE MSEG-MENGE,
MENGE_TO LIKE MSEG-MENGE,
MENGE_TI LIKE MSEG-MENGE,
MENGE_S LIKE MSEG-MENGE,
MENGE_ST LIKE MSEG-MENGE,
MENGE_AD LIKE MSEG-MENGE,
MENGE_RT LIKE MSEG-MENGE,
MENGE_C LIKE MSEG-MENGE,
MENGE_CL LIKE MSEG-MENGE,
MENGE_BAL LIKE MSEG-MENGE,
MENGE_CR LIKE MSEG-MENGE,
NAME1 LIKE T001W-NAME1,
MENGE_RE LIKE MSEG-MENGE,
MENGE_IS LIKE MSEG-MENGE,
MENGE_BAL1 LIKE MSEG-MENGE,
SHKZG LIKE MSEG-SHKZG,
MENGE LIKE MSEG-MENGE,
LGORT LIKE MSEG-LGORT,
END OF INT_DATA.
DATA: BEGIN OF INT_DATA1 OCCURS 50,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
BWART LIKE MSEG-BWART,
MENGE_ST LIKE MSEG-MENGE,
MENGE_O LIKE MSEG-MENGE,
WAMNG LIKE EKET-WAMNG,
WEMNG LIKE EKET-WEMNG,
MENGE LIKE MSEG-MENGE,
RETPO LIKE EKPO-RETPO,
UMREN LIKE EKPO-UMREN,
UMREZ LIKE EKPO-UMREZ,
BSTMG LIKE EKPO-MENGE,
XBLNR LIKE MKPF-XBLNR,
END OF INT_DATA1.
DATA: BEGIN OF INT_DATA2 OCCURS 50,
WERKS LIKE MSEG-WERKS,
LGORT LIKE S031-LGORT,
MATNR LIKE MSEG-MATNR,
BWART LIKE MSEG-BWART,
MENGE_IS LIKE MSEG-MENGE,
MBWBEST LIKE S032-MBWBEST,
MAKTX LIKE MAKT-MAKTX,
END OF INT_DATA2.
DATA:V_GJAHR LIKE MKPF-BUDAT.
SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE TEXT-064.
SELECT-OPTIONS:
MATNR FOR MSEG-MATNR,
MATKL FOR MARA-MATKL OBLIGATORY,
WERKS FOR MSEG-WERKS OBLIGATORY,
LGORT FOR MSEG-LGORT,
*CHARG FOR MSEG-CHARG,
BWART FOR MSEG-BWART,
*LIFNR FOR LFA1-LIFNR,
*WADAT FOR LIKP-WADAT_IST,
S_DATE FOR MKPF-BUDAT.
SELECTION-SCREEN END OF BLOCK 0.
TOP-OF-PAGE.
PERFORM HEADER_WRITE.
FORM FETCH_DATA .
SELECT
MATNR " Material Number
WERKS " Plant
INTO TABLE IT_HEADER
FROM MSEG
WHERE MATNR = IT_HEADER-MATNR AND
WERKS = IT_HEADER-WERKS.
STR3 = S_DATE-LOW+0(4).
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB1
WHERE MATNR IN MATNR AND
MATKL IN MATKL.
SELECT MATNR WERKS LGORT
INTO TABLE ITAB2
FROM MARD FOR ALL ENTRIES IN ITAB1
WHERE WERKS IN WERKS AND
LGORT IN LGORT AND
MATNR = ITAB1-MATNR.
SELECT SINGLE NAME1 FROM T001W INTO INT_DATA-NAME1
WHERE WERKS = INT_DATA-WERKS.
LOOP AT ITAB2.
SELECT M~MATNR M~WERKS M~LGORT M~MENGE M~MBLNR M~MJAHR M~XAUTO M~SHKZG
M~BWART M~EBELN N~BUDAT N~XBLNR S~NAME1
INTO CORRESPONDING FIELDS OF ITAB
FROM MSEG AS M INNER JOIN MKPF AS N ON
M~MBLNR = N~MBLNR
AND M~MJAHR = N~MJAHR
INNER JOIN T001W AS S ON
M~WERKS = S~WERKS
WHERE N~BUDAT IN S_DATE AND
M~WERKS = ITAB2-WERKS AND
M~LGORT = ITAB2-LGORT AND
M~MATNR = ITAB2-MATNR AND
M~BWART IN BWART.
APPEND ITAB.
CLEAR ITAB.
ENDSELECT.
IF SY-SUBRC NE 0.
ITAB-MATNR = ITAB2-MATNR.
ITAB-WERKS = ITAB2-WERKS.
ITAB-LGORT = ITAB2-LGORT.
ITAB-BWART = ITAB2-BWART.
APPEND ITAB.
ENDIF.
CLEAR: ITAB2,ITAB.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM ITAB2 COMPARING MATNR WERKS .
V_MONTH = S_DATE-LOW+0(6).
SELECT * INTO CORRESPONDING FIELDS OF TABLE INT_DATA2
FROM S032 FOR ALL ENTRIES IN ITAB2
WHERE MATNR = ITAB2-MATNR
AND WERKS = ITAB2-WERKS
AND LGORT = SPACE
AND MBWBEST <> SPACE.
LOOP AT INT_DATA2 .
SELECT SINGLE * FROM S031
WHERE MATNR = INT_DATA2-MATNR AND
WERKS = INT_DATA2-WERKS AND
LGORT = SPACE AND
SPMON GT V_MONTH.
MODIFY INT_DATA2.
CLEAR: INT_DATA2, S031.
ENDLOOP.
DELETE INT_DATA WHERE MENGE_O IS INITIAL .
DELETE ADJACENT DUPLICATES FROM INT_DATA COMPARING XBLNR MATNR MAKTX.
V_MONTH1 = S_DATE-LOW+0(6).
SORT ITAB BY MATNR WERKS XBLNR .
LOOP AT ITAB.
XBLNR = ITAB-XBLNR.
INT_DATA-MENGE = ITAB-MENGE.
INT_DATA-BWART = ITAB-BWART.
INT_DATA-XBLNR = ITAB-XBLNR.
INT_DATA-BUDAT = ITAB-BUDAT.
INT_DATA-MATNR = ITAB-MATNR.
INT_DATA-MBLNR = ITAB-MBLNR.
INT_DATA-MENGE = ITAB-MENGE.
INT_DATA-SHKZG = ITAB-SHKZG.
INT_DATA-MENGE_IS = ITAB-MENGE_IS.
INT_DATA-MENGE_RE = ITAB-MENGE_RE.
INT_DATA-MENGE_O = ITAB-MENGE_O.
INT_DATA-NAME1 = ITAB-NAME1.
IF FLAG = 1.
PERFORM GET_OPENING_STOCK.
ENDIF.
INT_DATA-MENGE_O = OSTOCK.
CASE ITAB-BWART.
WHEN '101'.
IF INT_DATA-SHKZG = 'S'.
INT_DATA-MENGE_R = INT_DATA-MENGE_R + ITAB-MENGE.
ENDIF.
WHEN '453'.
IF INT_DATA-SHKZG = 'S'.
IF ITAB-XAUTO = 'X'.
INT_DATA-MENGE_RT = INT_DATA-MENGE_RT + ITAB-MENGE.
ENDIF.
ENDIF.
WHEN '351' OR '641'.
IF ITAB-LGORT = 0.
INT_DATA-MENGE_R = INT_DATA-MENGE_R + ITAB-MENGE.
ELSE.
INT_DATA-MENGE_TO = INT_DATA-MENGE_TO + ITAB-MENGE.
ENDIF.
WHEN '602' OR '642'.
IF INT_DATA-SHKZG = 'S'.
IF ITAB-LGORT = 0.
INT_DATA-MENGE_CL = INT_DATA-MENGE_CL + ITAB-MENGE.
ENDIF.
ENDIF.
WHEN '552' OR '310'.
IF INT_DATA-SHKZG = 'S'.
INT_DATA-MENGE_AD = INT_DATA-MENGE_AD - ITAB-MENGE.
ENDIF.
WHEN '601'.
IF INT_DATA-SHKZG = 'H'.
INT_DATA-MENGE_S = INT_DATA-MENGE_S + ITAB-MENGE.
ENDIF.
WHEN '641' .
IF INT_DATA-SHKZG = 'H'.
IF ITAB-LGORT = 0.
INT_DATA-MENGE_TO = INT_DATA-MENGE_TO + ITAB-MENGE.
ENDIF.
ENDIF.
WHEN '454' OR '102'.
IF INT_DATA-SHKZG = 'H'.
IF ITAB-XAUTO = 'X'.
INT_DATA-MENGE_CR = INT_DATA-MENGE_CR - ITAB-MENGE.
ENDIF.
ENDIF.
WHEN '551' OR '309'.
IF INT_DATA-SHKZG = 'H'.
INT_DATA-MENGE_AD = INT_DATA-MENGE_AD + ITAB-MENGE.
ENDIF.
ENDCASE.
PERFORM BALANCE.
COLLECT INT_DATA.
CLEAR: INT_DATA,XBLNR, FLAG, OSTOCK.
IF INT_DATA-SHKZG = 'S'.
MENGE_RE = INT_DATA-MENGE_R + INT_DATA-MENGE_RT + INT_DATA-MENGE_CL
+ INT_DATA-MENGE_AD.
ENDIF.
IF INT_DATA-SHKZG = 'H'.
MENGE_IS = INT_DATA-MENGE_S + INT_DATA-MENGE_TO +
INT_DATA-MENGE_CR + INT_DATA-MENGE_AD.
ENDIF.
ENDLOOP.
SORT INT_DATA BY XBLNR BUDAT WERKS MATNR.
LOOP AT INT_DATA.
AT NEW MATNR.
FLAG = 1.
IT_HEADER-MATNR = INT_DATA-MATNR.
SELECT SINGLE MAKTX FROM MAKT INTO IT_HEADER-MAKTX WHERE
MATNR = IT_HEADER-MATNR and spras = 'E'.
APPEND IT_HEADER.
CLEAR IT_HEADER.
endat.
ENDLOOP.
LOOP AT INT_DATA.
READ TABLE INT_DATA2 WITH KEY MATNR = INT_DATA-MATNR
WERKS = INT_DATA-WERKS.
SELECT SINGLE * FROM MAKT WHERE MATNR = INT_DATA-MATNR.
INT_DATA-MAKTX = MAKT-MAKTX.
MODIFY INT_DATA.
CLEAR: INT_DATA, INT_DATA2.
ENDLOOP.
LOOP AT INT_DATA WHERE MENGE_O = 0 AND MENGE_RT = 0 AND
MENGE_CL = 0 AND MENGE_AD = 0 AND
MENGE_S = 0 AND MENGE_TO = 0 AND
MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.
DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.
ENDLOOP.
DELETE INT_DATA WHERE MENGE_O = 0 AND MENGE_RT = 0 AND
MENGE_CL = 0 AND MENGE_AD = 0 AND
MENGE_S = 0 AND MENGE_TO = 0 AND
MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.
PERFORM WRITE_REPORT.
INT_DATA-MENGE_O = OSTOCK.
PERFORM GET_OPENING_STOCK.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/1 SY-VLINE,
106 'Opening Balance' CENTERED,
130 SY-VLINE,
156 SY-VLINE.
WRITE: 130(8) OSTOCK.
WRITE:/1(156) SY-ULINE.
FORMAT RESET.
LOOP AT INT_DATA.
FORMAT COLOR 2 INTENSIFIED OFF.
WRITE:/1 SY-VLINE,
2 INT_DATA-XBLNR,
14 SY-VLINE,
15 INT_DATA-BUDAT,
27 SY-VLINE,
28 INT_DATA-BWART,
40 SY-VLINE,
43(9) INT_DATA-MENGE_R,
51 SY-VLINE,
52(9) INT_DATA-MENGE_RT,
65 SY-VLINE,
66(9) INT_DATA-MENGE_CL,
82 SY-VLINE,
83(7) INT_DATA-MENGE_AD,
89 SY-VLINE,
90(9) INT_DATA-MENGE_S,
97 SY-VLINE,
98(9) INT_DATA-MENGE_TO,
106 SY-VLINE,
107(9) INT_DATA-MENGE_CR,
120 SY-VLINE,
121(9) INT_DATA-MENGE_AD,
130 SY-VLINE,
131(9) INT_DATA-MENGE_BAL,
144 SY-VLINE,
145 INT_DATA-MBLNR,
156 SY-VLINE.
FORMAT RESET.
ENDLOOP.
WRITE:/1(156) SY-ULINE.
ENDFORM.
FORM WRITE_REPORT.
SORT IT_HEADER BY MATNR.
LOOP AT IT_HEADER.
SKIP .
AT NEW MATNR.
WRITE:/1(60) SY-ULINE.
READ TABLE IT_HEADER INDEX SY-TABIX.
WRITE:/1 SY-VLINE,
2 'Material :'(006),14(7) IT_HEADER-MATNR NO-GAP,'-',
IT_HEADER-MAKTX,
60 SY-VLINE.
WRITE:/1(60) SY-ULINE.
SKIP.
SET LEFT SCROLL-BOUNDARY COLUMN 50.
WRITE:/1(156) SY-ULINE.
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE:/1 SY-VLINE,
2 'Doc. No' CENTERED,
14 SY-VLINE,
15(14) 'Doc.Date' CENTERED,
27 SY-VLINE,
28(10) 'MVT' CENTERED,
40 SY-VLINE,
41(57) 'Receipts' CENTERED,
89 SY-VLINE, 90(47) 'Issues' CENTERED,130 SY-VLINE,131(12) 'Balance' CENTERED,144 SY-VLINE,
145 'MAT.DOC NO' CENTERED,156 SY-VLINE,
/41 SY-VLINE,1 SY-VLINE,14 SY-VLINE,27 SY-VLINE,40 SY-VLINE,89 SY-VLINE,130 SY-VLINE,144 SY-VLINE,156 SY-VLINE,
40 SY-ULINE,
/40 SY-VLINE,
43 'STO-In' CENTERED , 51 SY-VLINE,
52 'Sales Returns' CENTERED , 65 SY-VLINE,
66 'Canc of Invoice' CENTERED, 82 SY-VLINE,
83 'Adj' CENTERED, 89 SY-VLINE,
90 'Sales' CENTERED, 97 SY-VLINE,
98 'STO-Out' CENTERED, 106 SY-VLINE,
107 'Canc of Sales' CENTERED, 120 SY-VLINE,
121 'Adj' CENTERED, 130 SY-VLINE,144 SY-VLINE,156 SY-VLINE,
1 SY-VLINE,14 SY-VLINE,27 SY-VLINE,40 SY-VLINE.
WRITE:/1(156) SY-ULINE.
*LOOP AT INT_DATA.
*PERFORM GET_OPENING_STOCK.
*APPEND INT_DATA.
*ENDLOOP.
FORMAT RESET.
ENDAT.
ENDLOOP.
ENDFORM.
*& Form BALANCE
text
--> p1 text
<-- p2 text
FORM BALANCE.
IF INT_DATA-SHKZG = 'S'.
MENGE_RE = INT_DATA-MENGE_O + INT_DATA-MENGE.
INT_DATA-MENGE_BAL = MENGE_RE.
INT_DATA-MENGE_RE = INT_DATA-MENGE.
ELSEIF INT_DATA-SHKZG = 'H'.
MENGE_RE = MENGE_RE - INT_DATA-MENGE.
INT_DATA-MENGE_BAL = MENGE_RE.
INT_DATA-MENGE_IS = INT_DATA-MENGE.
ENDIF.
ENDFORM. " BALANCE
FORM HEADER_WRITE.
SKIP.
WRITE: /1(156) SY-ULINE.
WRITE: /1 SY-VLINE,
2(144) 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
INTENSIFIED CENTERED," INVERSE ON
156 SY-VLINE.
WRITE: /1(156) SY-ULINE.
WRITE: /1 SY-VLINE,
2(156) 'STOCK LEDGER' INTENSIFIED CENTERED,
"INVERSE ON,
156 SY-VLINE.
WRITE: /1(156) SY-ULINE.
SELECT SINGLE * FROM T001W WHERE
WERKS IN WERKS.
IF WERKS-HIGH EQ SPACE.
CONCATENATE 'Plant : ' WERKS-LOW INTO TXT.
ELSE.
CONCATENATE 'FROM PLANT : ' WERKS-LOW 'TO PLANT : ' WERKS-HIGH INTO TXT SEPARATED BY SPACE.
ENDIF.
WRITE:/ 'Plant :', WERKS-LOW,SPACE ,'-', T001W-NAME1,
82 'As Of Date :', 95 sy-datum.
IF NOT S_DATE IS INITIAL.
WRITE: / 'From:'(004), S_DATE-LOW, SPACE, 'To:'(006), S_DATE-HIGH,82 'PAGE No:', 91 SY-PAGNO..
ENDIF.
*IF FLAG5 = 'E'.
PERFORM WRITE_REPORT.
*ENDIF.
FORMAT RESET.
endform.
*& Form GET_OPENING_STOCK
text
FORM GET_OPENING_STOCK.
SELECT SUM( MZUBB ) SUM( MAGBB ) INTO (V_STOCK, V_STOCK1)
FROM S031 WHERE MATNR = ITAB-MATNR AND
WERKS = ITAB-WERKS AND
SPMON LT V_MONTH1 AND LGORT = ITAB-LGORT.
OSTOCK = V_STOCK1 - V_STOCK.
IF OSTOCK < 0.
OSTOCK = OSTOCK * -1.
ENDIF.
ENDFORM. " GET_OPENING_STOCK
Thanks & Regards,
Sreedhar.
Hi,
Check if the data is there in the data target on which your report is based.
Check to see if this data is available for reporting.
Check to see if you have auth to view this data.
Check if there are any filters or restrictions in the query that would prevent the data from being displayed.
Check the data through LISTCUBE transaction.
Hope this helps...
Similar Messages
-
Regarding : Material document data and PO data do not match (Plant)
Hi Gurus,
Please go through this BAPI program.
While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
DATA: BEGIN OF it_itab OCCURS 100,
docdate(10),
postdate(10),
mvt_type(3), "Movement Type
plant(4), "Plant
lgort(4),
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
material(18), "Material Number
delnote(16),
erfmg(13),
uom(3),
lfmng(13), "Quantity
batch(10) TYPE c,
vfdat TYPE vfdat,
END OF it_itab.
DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01 INITIAL SIZE 100,
it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code INITIAL SIZE 100,
it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create INITIAL SIZE 100.
DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
DATA: w_mat_doc TYPE bapi2017_gm_head_ret-mat_doc,
w_year TYPE bapi2017_gm_head_ret-doc_year.
DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_errmsg_goodsmvt.
DATA : obj_type LIKE bapiache09-obj_type,
obj_key LIKE bapiache09-obj_key,
obj_sys LIKE bapiache09-obj_sys.
DATA: v_date1 TYPE sy-datum.
DATA: v_date2 TYPE sy-datum.
DATA: w_lines TYPE i.
DATA: errflag.
SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK bk1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
Start-of-selection processing
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = i_excel
i_filename = p_file
TABLES
i_tab_converted_data = it_itab[]
EXCEPTIONS
conversion_failed = 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.
LOOP AT it_itab.
REFRESH it_goodsmvt_head.
REFRESH it_goodsmvt_item.
CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
wa_goodsmvt_head-pstng_date = v_date2.
wa_goodsmvt_head-doc_date = v_date1.
wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
wa_goodsmvt_head-pr_uname = sy-uname.
APPEND wa_goodsmvt_head TO it_goodsmvt_head.
Maintain it_goodsmvt_code
wa_goodsmvt_code-gm_code = '04'.
Maintain it_goodsmvt_item
*LOOP AT it_itab.
IF wa_goodsmvt_item-po_number IS INITIAL.
wa_goodsmvt_item-po_number = it_itab-pur_doc.
wa_goodsmvt_item-move_type = it_itab-mvt_type.
wa_goodsmvt_item-MOVE_PLANT = it_itab-plant.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = it_itab-material
IMPORTING
output = it_itab-material.
wa_goodsmvt_item-material = it_itab-material.
wa_goodsmvt_item-stge_loc = it_itab-lgort.
wa_goodsmvt_item-po_item = it_itab-po_item.
wa_goodsmvt_item-entry_qnt = it_itab-erfmg.
wa_goodsmvt_item-ENTRY_UOM_ISO = it_itab-uom.
wa_goodsmvt_item-po_pr_qnt = it_itab-lfmng.
wa_goodsmvt_item-batch = it_itab-batch.
wa_goodsmvt_item-expirydate = it_itab-vfdat.
wa_goodsmvt_item-NO_MORE_GR = 'X'.
wa_goodsmvt_item-mvt_ind = 'B'.
APPEND wa_goodsmvt_item TO it_goodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_goodsmvt_head
goodsmvt_code = wa_goodsmvt_code
IMPORTING
materialdocument = w_mat_doc
TABLES
goodsmvt_item = it_goodsmvt_item
return = it_errmsg_goodsmvt.
Process of commit work
IF it_goodsmvt_head[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
ENDIF.
IF it_goodsmvt_item[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IMPORTING
RETURN =
CLEAR errflag.
READ TABLE it_errmsg_goodsmvt INDEX 1.
IF it_errmsg_goodsmvt-type EQ 'E'.
WRITE:/'Error in function', it_errmsg_goodsmvt-message.
errflag = 'X'.
ELSE.
WRITE:/ it_errmsg_goodsmvt-message.
ENDIF.
IF errflag IS INITIAL.
COMMIT WORK AND WAIT.
IF sy-subrc NE 0.
WRITE:/ 'Error in updating'.
EXIT.
ELSE.
WRITE:/ 'Material Document created successfully and the Document Number for the Material',
wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.Hey,
Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
Mine is solved....
Thanks -
Status 51 material document data and po data do not match(vendor)
i am using we19 to try an inbound idoc mbgmcr(receipt for po)
i put in gm_code 01
movement indicator B(goods receipt for po)
vendor 3815
PO 4500015241
PO Order Item 00030
Movement type 101
qty in unit of entry 1
iso code unit of measurement pc
on the po screen i see the po item and qty to be delivered is 75
when i run the inbound idoc i get
status 51 material document data and po data do not match(vendor) but as i say on the po inquiry screen i see the po vendor item with 75 to be delivered
what am i missing????????????????thank you
i put in the leading zeros and got rid of that problem
now i am getting status 51
posting only possible in 2004/07 and 2004/06
but in the posting date i use 07/02/2004 i have tried several dates in the period but get the same error
any ideas?
thanks you -
Not able to select data using DB link.
Hi ,
I have created the database link in oracle 8.1.7.0.0 to oracle 8.1.7.4.0
But I am not able to select data using DB link.
The error is = ORA 12154 : TNS: could not resolve service name.
I have created the DB link with the same command in oracle 9.2.0.4.0 to oracle 8.1.7.4.0. I can select data using this link.
Please suggest me the solution.
Thanks,
ShaileshIf the service name is different on the 8i machine than on the 9i machine, you'll need to modify the service name when creating the link from 8i. Can you see the DB link in ALL_DB_LINKS in the 8i database?
-
Material availability date can not be after the delivery date
Dear Experts,
we are using the following scnario,
1. Once the user creates the sales order, automatically system creates PO in the background.
we have created Bapi program for creation of Background PO in SD User Exit.
The following issue occurs in Prd, DS1, QS1 server, We have done Technical upgradation project, Now when we creates sales order automatically po created with error message of Material availablity date can not be after the delivery date. even sales order no also not updated in the PO.
QAS server (without technical upgrade) i refered the same input parameter and used the same and create the sales order system generates PO automatically without error message.
Does any one can through lights on this issue,
Thanks and Best Regards,
Muralidharan SHi
The dates are determined due to shipping and transportation scheduling settings. So check whether the shipping and transportation scheduling is being performed as per the cofiguration settings after Technical upgrade. Since the MAD date should not be after Delivery date but it seems that the dates are not determined properly.
Also check the Transit time, Loading time, Pick/Pack time and Lead time are retained as same as before the technical upgrade. Use the QAS server settings to validate the settings in other servers.
Regards
Rajkumar K -
I have my ipad notes linked to gmail and suddenly disappeared when I put the sim card into a new iphone, the funny thing is that almost all disappeared except 4 and with different dates up to two years. Why did this happen? No way to recover them?
Wow, Karan Taneja, you've just embarrassed yourself on a worldwide support forum. Not only is your post ridiculous and completely inappropriate for a technical support forum, but it also shows your ignorance as to whom you think the audience is. Apple is not here. It's users, like you.
If you would have spent half the time actually reading the Terms of Use of this forum that YOU agreed to by signing up to post, as you did composing that usesless, inappropriate post, you (and the rest of us on this forum) would have been much better off. -
Parent not O.K.:MATERIAL issue while uploading CMIR data in CRM
Hi All,
I am facing the issue while doing the initial load for customer material information record. As per the information of the sap note i have deleted parent adapter object BUPA_MAIN and added customer_main. i have tried but still the problem coming by saying Parent not O.K.:Customer_main. i have removed this customer_main also but now again am getting Parent not O.K.:MATERIAL. So finally it is not even moved a bit ahead. Please have a look and revert me.
Shyam K GangisettiHi Raymond,
Thanks for your reply.Yes,If I use CONVERSION_EXIT_CUNIT_INPUT in my program the issue is, Assume If the user is giving PC as value for UOM field in flat file and upload the flat file.It is successfully uploading the value PC to the UOM field in transaction VK13 but the in the database table(konp) it is showing the value as ST.
Regards,
Chakradhar. -
HR master data authorizations Personnel Sub Area (PSA) wise
Hi Experts,
The requirement is to restrict HR masterdata access PSA wise.
Example:-
There are 2 PSAs i.e. 1000 & 2000 for which, there are two different HR admin who are responsible for the maintenance of the HR masterdata for their respective PSAs.
The requirement is, the HR admin of 1000 PSA should have the authorization of create/change/display of 1000 PSA & should have only the display authorization for 2000 PSA. HR admin of 1000 PSA can not modify the details of other PSAs.
Like the same way, HR admin of 2000 PSA should have the authorization of create/change/display of 2000 PSA & should have only the display authorization for 1000 PSA.
I have managed to handle the same through org key (VDSK1). But the issue is, the HR admin of 1000 is only able see the data upto the period when the employee was in 1000 PSA. For e.g. if employee no. 789654 was in 1000 PSA from 1.1.2014 to 31.03.2014 & he was transferred to 2000 PSA on 1.4.2014, then the HR admin of 1000 is able to see the data upto 31.03.2014 only. And HR admin of 2000 PSA is able to see the data from 1.4.2014 onwards & not the past data.
During a transfer action, I am manually changing the org key when I am transferring the employee from one PSA to other PSA.
Requirement
My requirement is that, after the transfer also, the HR admin of the 1st PSA (1000) should be able to only view the current employee data & but he can not change anything and the same way HR admin of 2000 PSA should be able to view the past data but should not able to change the past data.
How it will work in Training & Event Mgt? Will the system restricts the HR admin from booking an employee of other PSA also?
Please help..
Regards,
DanielHi Omid,
Thanks for your reply. I saw your link where you have suggested for custom authorization object. Does it require any other development other than creating the custom object?
I have managed to achieve the PSA wise authorization by using org key. But the problem is, the current HR administrator is not able to see the past data. For e.g. if employee no. 789654 was in 1000 PSA from 1.1.2014 to 31.03.2014 & he was transferred to 2000 PSA on 1.4.2014, then the HR admin of 1000 is able to see the data upto 31.03.2014 only. And HR admin of 2000 PSA is able to see the data from 1.4.2014 onwards & not the past data.
My requirement is; the current HR admin can view all the past and current data but not authorized to create/change or delete anything once the employee is transferred from his PSA.
Regards,
Daniel -
How to link Variant Material with Class n Char ?
Hi,
I am new to variant Config.
I created Char, --> Class n dependencies.
Created KMAT material.
But i m confused how to link Materil to the Class or is there anymore i have to do for setting?
PL. guide.
thanks,
Roopan.Here are the simple steps to follow to link the material to class. The steps also include set-up for creating material to assignment.
1. Create Material
Menu Path: Logistics Materials Management Master Data Material- Create
<b>Transaction Code: MM01</b>
[Enter the material type as Configurable Material.
Ensure that check box Material is configurable is checked (i.e. MARA-KZKFG has value X) in Basic Data view]
2. Create Characteristics
Menu Path: Logistics Central Functions Classification Master Data Characteristics - Create
<b>Transaction Code: CT04</b>
All the required characteristics should be created before proceeding to next step.
3. Create Class
Menu Path: Logistics Central Functions Classification Master Data Class - Create. <b>Transaction Code: CL01</b>
Enter name of class.
Enter class type as 300 - Variants.
Enter description and other relevant details.
4. ASSIGN CHARACTERISTICS TO CLASS
Menu Path: Logistics Central Functions Classification Master Data Class - Change <b>[Transaction Code: CL02]</b>
<b>Note:</b> Assignment of characteristics to class can be done while creating class also, if all the characteristics are created before creating class.
Go to Characteristics tab and assign all the characteristics in sequence in which you want them to appear logically.
5. CREATE CONFIGURATION PROFILE
Menu Path: Logistics Central Functions Variant Configuration Configuration Profile Create <b>[Transaction Code: CU41]</b>
Material to class assignment is created via Configuration Profile.
Regards,
Gauravjit.
Reward points if the solution is helpful -
Link between Material code, Customer & Certificate Profile (Quality)
Hi All
I develop one smart form for quality certificate.
But I am not able to find out the link between Material, Customer & Certificate profile.
In which table these all data are storing.
On the basis of above condition MIC will print on Quality certificate.
Regards
ARKIt should be posted in QM forum, isn't it? Anyway, try this.
First you get the profile schema in table T683 (configuration of profile schema in Quality Management -> Quality certificates -> Certification Profile -> Profile determination -> Define schema for profile determination). Standard one is QC0001.
Then you use function call V61I_CERT_PROFILE_FINDING with parameter (standard routine for finding certificate profile. Unless you have the user exit, this routine should work):
I_APPLICATION = QC
I_DATE = current date or whatever date (i.e., delivery date in outbound delivery)
I_DIALOG = leave blank
I_HEADER_COMMUNICATION => here you can put in your customer, material, plant ; depend on your access sequence
I_SCHEME = value from table T683
You will get the output in table E_KONDI which give you data of condition rec. no, certification type, profile and version.
Then you can use certification type, profile and version to select the characteristics from QCVM.
Hope it helps. -
ICal Week view, Date is not aligned with the Time(schedule) of each date
Well, just like it says over there (`` ). I've recently been to China for a business trip, and I suppose the different time zone may have had something to do with the problem. Now I'm back home, changed the time zone back to normal, still the iCal shows in the weekly view that the Date on the above is not aligning with the Time and schedule. Any suggetions would be grateful!!!
Hi,
i omit the scheduling maergin key in material master,
the result of MRP is
BASIC DATES
Finish 15.10.2009
Start 14.10.2009
PRODUCTION DATES
15.02.2010 14:33:25
14.10.2009 07:00:00
scheduling type i planned order is still "backwards"
so in MD04 it is say that the goods is available at 15.10.2009 same with requirement dates.
this seem not right.
it seems that order finish date is not adjusted by lead time scheduling on "today scheduling".
Is there a way so order finish date is adjusted by lead time scheduling on "today scheduling" ????
Best regards,
Freddy Ha
Edited by: Freddy Halim on Oct 14, 2009 10:01 AM -
How to I get Values of key figure by customer if cube data is not by cust?
HI All,
I have a situation where I need to change query : This query is created on a Multiprovider gives Actuals sales for previous period and Forecast for future period. The query is designed at aggregatred sales dist by Material.
Now the Business requires this by Sales District. I did this by creating a Variable filter.
Now the issue is For Each material is 4 rows and one of the row is Standar price. This data is availabe for Actuals by sales district but of Forecast this is not avilabel by sales district.
I want this data in report - for If I execute report for aggregated of all sales district I can see this figure but If i filter by sales district I cannot see as the data is not availabe by Sales district. Now as Std cost is same of materisl for any sales district. Can some one help is how do I get this data populated in report even if I select by Sales district ?
Hope I made this clear - please advice if not clear.
Thanks
SivaCreate two RKF, restrict first with [ from = '#' ] to get the planned receipts, and restrict the second with [ from <> '#' and to <> '#' ] to get the issues.
-
Data is not getting replicating to the destination db.
I has set up streams replication on 2 databases running Oracle 10.1.0.2 on windows.
Steps for setting up one-way replication between two ORACLE databases using streams at schema level followed by the metalink doc
I entered a few few records in the source db, and the data is not getting replication to the destination db. Could you please guide me as to how do i analyse this problem to reach to the solution
setps for configuration _ steps followed by metalink doc.
==================
Set up ARCHIVELOG mode.
Set up the Streams administrator.
Set initialization parameters.
Create a database link.
Set up source and destination queues.
Set up supplemental logging at the source database.
Configure the capture process at the source database.
Configure the propagation process.
Create the destination table.
Grant object privileges.
Set the instantiation system change number (SCN).
Configure the apply process at the destination database.
Start the capture and apply processes.
Section 2 : Create user and grant privileges on both Source and Target
2.1 Create Streams Administrator :
connect SYS/password as SYSDBA
create user STRMADMIN identified by STRMADMIN;
2.2 Grant the necessary privileges to the Streams Administrator :
GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE,DBA to STRMADMIN;
In 10g :
GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE,DBA to STRMADMIN;
execute DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');
2.3 Create streams queue :
connect STRMADMIN/STRMADMIN
BEGIN
DBMS_STREAMS_ADM.SET_UP_QUEUE(
queue_table => 'STREAMS_QUEUE_TABLE',
queue_name => 'STREAMS_QUEUE',
queue_user => 'STRMADMIN');
END;
Section 3 : Steps to be carried out at the Destination Database PLUTO
3.1 Add apply rules for the Schema at the destination database :
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'SCOTT',
streams_type => 'APPLY ',
streams_name => 'STRMADMIN_APPLY',
queue_name => 'STRMADMIN.STREAMS_QUEUE',
include_dml => true,
include_ddl => true,
source_database => 'REP2');
END;
3.2 Specify an 'APPLY USER' at the destination database:
This is the user who would apply all DML statements and DDL statements.
The user specified in the APPLY_USER parameter must have the necessary
privileges to perform DML and DDL changes on the apply objects.
BEGIN
DBMS_APPLY_ADM.ALTER_APPLY(
apply_name => 'STRMADMIN_APPLY',
apply_user => 'SCOTT');
END;
3.3 Start the Apply process :
DECLARE
v_started number;
BEGIN
SELECT decode(status, 'ENABLED', 1, 0) INTO v_started
FROM DBA_APPLY WHERE APPLY_NAME = 'STRMADMIN_APPLY';
if (v_started = 0) then
DBMS_APPLY_ADM.START_APPLY(apply_name => 'STRMADMIN_APPLY');
end if;
END;
Section 4 :Steps to be carried out at the Source Database REP2
4.1 Move LogMiner tables from SYSTEM tablespace:
By default, all LogMiner tables are created in the SYSTEM tablespace.
It is a good practice to create an alternate tablespace for the LogMiner
tables.
CREATE TABLESPACE LOGMNRTS DATAFILE 'logmnrts.dbf' SIZE 25M AUTOEXTEND ON
MAXSIZE UNLIMITED;
BEGIN
DBMS_LOGMNR_D.SET_TABLESPACE('LOGMNRTS');
END;
4.2 Turn on supplemental logging for DEPT and EMPLOYEES table :
connect SYS/password as SYSDBA
ALTER TABLE scott.dept ADD SUPPLEMENTAL LOG GROUP dept_pk(deptno) ALWAYS;
ALTER TABLE scott.EMPLOYEES ADD SUPPLEMENTAL LOG GROUP dep_pk(empno) ALWAYS;
Note: If the number of tables are more the supplemental logging can be
set at database level .
4.3 Create a database link to the destination database :
connect STRMADMIN/STRMADMIN
CREATE DATABASE LINK PLUTO connect to
STRMADMIN identified by STRMADMIN using 'PLUTO';
Test the database link to be working properly by querying against the
destination database.
Eg : select * from global_name@PLUTO;
4.4 Add capture rules for the schema SCOTT at the source database:
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
schema_name => 'SCOTT',
streams_type => 'CAPTURE',
streams_name => 'STREAM_CAPTURE',
queue_name => 'STRMADMIN.STREAMS_QUEUE',
include_dml => true,
include_ddl => true,
source_database => 'REP2');
END;
4.5 Add propagation rules for the schema SCOTT at the source database.
This step will also create a propagation job to the destination database.
BEGIN
DBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES(
schema_name => 'SCOTT',
streams_name => 'STREAM_PROPAGATE',
source_queue_name => 'STRMADMIN.STREAMS_QUEUE',
destination_queue_name => 'STRMADMIN.STREAMS_QUEUE@PLUTO',
include_dml => true,
include_ddl => true,
source_database => 'REP2');
END;
Section 5 : Export, import and instantiation of tables from
Source to Destination Database
5.1 If the objects are not present in the destination database, perform
an export of the objects from the source database and import them
into the destination database
Export from the Source Database:
Specify the OBJECT_CONSISTENT=Y clause on the export command.
By doing this, an export is performed that is consistent for each
individual object at a particular system change number (SCN).
exp USERID=SYSTEM/manager@rep2 OWNER=SCOTT FILE=scott.dmp
LOG=exportTables.log OBJECT_CONSISTENT=Y STATISTICS = NONE
Import into the Destination Database:
Specify STREAMS_INSTANTIATION=Y clause in the import command.
By doing this, the streams metadata is updated with the appropriate
information in the destination database corresponding to the SCN that
is recorded in the export file.
imp USERID=SYSTEM@pluto FULL=Y CONSTRAINTS=Y FILE=scott.dmp IGNORE=Y
COMMIT=Y LOG=importTables.log STREAMS_INSTANTIATION=Y
5.2 If the objects are already present in the desination database, there
are two ways of instanitating the objects at the destination site.
1. By means of Metadata-only export/import :
Specify ROWS=N during Export
Specify IGNORE=Y during Import along with above import parameters.
2. By Manaually instantiating the objects
Get the Instantiation SCN at the source database:
connect STRMADMIN/STRMADMIN@source
set serveroutput on
DECLARE
iscn NUMBER; -- Variable to hold instantiation SCN value
BEGIN
iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
DBMS_OUTPUT.PUT_LINE ('Instantiation SCN is: ' || iscn);
END;
Instantiate the objects at the destination database with
this SCN value. The SET_TABLE_INSTANTIATION_SCN procedure
controls which LCRs for a table are to be applied by the
apply process. If the commit SCN of an LCR from the source
database is less than or equal to this instantiation SCN,
then the apply process discards the LCR. Else, the apply
process applies the LCR.
connect STRMADMIN/STRMADMIN@destination
BEGIN
DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN(
SOURCE_SCHEMA_NAME => 'SCOTT',
source_database_name => 'REP2',
instantiation_scn => &iscn );
END;
Enter value for iscn:
<Provide the value of SCN that you got from the source database>
Note:In 9i, you must instantiate each table individually.
In 10g recursive=true parameter of DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN
is used for instantiation...
Section 6 : Start the Capture process
begin
DBMS_CAPTURE_ADM.START_CAPTURE(capture_name => 'STREAM_CAPTURE');
end;
/same problem, data not replicated.
its captured,propagated from source,but not applied.
also no apply errors in DBA_APPLY_ERROR. Looks like the problem is that LCRs propagated from source db do not reach target queue.can i get any help on this?
queried results are as under:
1.at source(capture process)
Capture Session Total
Process Session Serial Redo Entries LCRs
Number ID Number State Scanned Enqueued
CP01 16 7 CAPTURING CHANGES 1010143 72
2. data propagated from source
Total Time Executing
in Seconds Total Events Propagated Total Bytes Propagated
7 13 6731
3. Apply at target(nothing is applied)
Coordinator Session Total Total Total
Process Session Serial Trans Trans Apply
Name ID Number State Received Applied Errors
A001 154 33 APPLYING 0 0 0
4. At target:(nothing in buffer)
Total Captured LCRs
Queue Owner Queue Name LCRs in Memory Spilled LCRs in Buffered Queue
STRMADMIN STREAMS_QUEUE 0 0 0 -
Data is not fetching in inner join
Hi Experts,
I developed a select query using inner joins, all the fields data is gettting appended, but one field DISPO data is not getting appeneded. please check the innerjoin and suggest me ur soluitons.
MODULE GET_DATA OUTPUT.
select arbpl
sptag
aufnr
plnum
posnr
plnfl
werks from s022
into table it_s022
where arbpl in s_arbpl
and werks in s_werks
and sptag in s_sptag
and matnr in s_matnr.
if sy-subrc eq 0.
select a~aufnr
a~posnr
a~kdauf
a~pgmng
a~plnum
a~strmp
b~plnty
b~gamng
b~igmng
b~iasmg
b~rmnga
b~gstrp
b~rsnum
b~plnbez
b~dispo
c~maktx
b~plnnr
b~plnty
b~zaehl
d~vornr
d~ltxa1
b~aufpl
b~aplzt
e~astnr
into corresponding fields of table it_afpo from afko as b
inner join afpo as a
on a~aufnr = b~aufnr
inner join makt as c
on b~plnbez = c~matnr
inner join plpo as d
on b~plnnr = d~plnnr
and b~plnty = d~plnty
and b~zaehl = d~zaehl
inner join aufk as e
on b~aufnr = e~aufnr
inner join marc as f
on bplnty = fmatnr
for all entries in it_s022
where b~aufnr = it_s022-aufnr.
and e~erdat = it_s022-sptag
and a~posnr = it_s022-posnr
and a~plnum = it_s022-plnum . .
if sy-subrc eq 0.
it_afpo1[] = it_afpo[].
sort it_afpo1 by aufpl." aplzt."""
delete ADJACENT DUPLICATES FROM it_afpo1 COMPARING aufpl." aplzt ."""
select aufpl
aplzl
fsavd
fsavz
ssedd
ssedz
mgvrg
FROM afvv INTO TABLE It_afvv
FOR ALL ENTRIES IN IT_afpo1
WHERE aufpl = IT_afpo1-aufpl.
and aplzl = it_afpo1-aplzt.
endif.
loop at it_afpo into wa_afpo.
DATA : G_SLNO(8) TYPE C.
G_SLNO = G_SLNO + 1.
wa_afpo-slno = g_slno.
move-corresponding wa_afpo to wa_final.
move-corresponding wa_afko to wa_final.
read table it_afvv into wa_afvv with key
aufpl = wa_afpo-aufpl binary search."aplzl = wa_afpo-aplzt binary search."""
*read table it_afko into wa_afko with key aufnr = wa_final-aufnr.
IF SY-SUBRC EQ 0.
move-corresponding wa_afvv to wa_final.
bal_qty = wa_final-gamng - wa_final-igmng.
move : wa_afpo-slno to wa_final-slno,
wa_afpo-aufnr to wa_final-aufnr,
wa_afpo-posnr to wa_final-posnr,
wa_afpo-kdauf to wa_final-kdauf, " Sales order Number
wa_afpo-pgmng to wa_final-pgmng, " Order item qty
wa_afpo-plnum to wa_final-plnum, " Planned Order Qty
wa_afpo-strmp to wa_final-strmp, " Planned Order Date
wa_afpo-gstrp to wa_final-gstrp, " Basic Finish date
wa_afpo-rsnum to wa_final-rsnum, " Number of Reservation
wa_afpo-plnbez to wa_final-plnbez, " Material Number
wa_afpo-maktx to wa_final-maktx,
wa_afpo-plnnr to wa_final-plnnr,
wa_afpo-plnty to wa_final-plnty,
wa_afpo-zaehl to wa_final-zaehl,
wa_afpo-vornr to wa_final-vornr,
wa_afpo-ltxa1 to wa_final-ltxa1,
wa_afpo-aufpl to wa_final-aufpl,
wa_afvv-fsavd to wa_final-fsavd,
wa_afvv-fsavz to wa_final-fsavz,
wa_afvv-ssedd to wa_final-ssedd,
wa_afvv-ssedz to wa_final-ssedz,
wa_afvv-mgvrg to wa_final-mgvrg,
wa_afko-igmng to wa_final-igmng,
wa_afko-iasmg to wa_final-iasmg,
wa_afko-rmnga to wa_final-rmnga,
wa_afko-dispo to wa_final-dispo,
wa_afko-bal_qty to wa_final-bal_qty,
wa_aufk-astnr to wa_final-astnr,
wa_afpo-text to wa_final-text.
*bal_qty = wa_final-gamng - wa_final-igmng.
*bal_qty = wa_afko-bal_qty.
endif.
append wa_final to it_final.
clear:wa_final ,wa_afpo,wa_afvv,wa_aufk,wa_afko.
endloop.
endif.
ENDMODULE. " GET_DATA OUTPUT
*& Module DISPLAY_DATA OUTPUT
text
MODULE DISPLAY_DATA OUTPUT.
IF REF_CONTAINER IS INITIAL.
PERFORM FIELD_CAT.
CREATE OBJECT REF_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTROL'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
L_LAYO-ZEBRA = 'X'.
L_LAYO-GRID_TITLE = 'JOB CARD'.
data: variant type disvariant.
CREATE OBJECT REF_ALV_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = REF_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 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.
l_variant-report = sy-cprog.
*data: l_prnt type lvc_s_prnt.
*l_prnt-print = 'X'.
SORT T_FCAT.
call method ref_alv_grid->set_ready_for_input
exporting
i_ready_for_input = 1.
create object event_receiver.
set handler event_receiver->handle_top_of_page for ref_alv_grid.
CALL METHOD REF_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
is_variant = variant "l_variant
i_save = 'X'
I_DEFAULT = 'X'
IS_LAYOUT = L_LAYO
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = IT_final[]
IT_FIELDCATALOG = T_FCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
create object g_event_receiver.
set handler g_event_receiver->handle_user_command for ref_alv_grid.
set handler g_event_receiver->handle_toolbar for ref_alv_grid.
§ 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
call method ref_alv_grid->set_toolbar_interactive.
call method cl_gui_control=>set_focus exporting control = ref_alv_grid.
ENDIF.
ENDMODULE. " DISPLAY_DATA OUTPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN001'.
SET TITLEBAR 'xxx'.
Regards,
Bharath KumarI agree with Shiva Kumar - most likely there is no such field in it_afpo. A few more suggestions though:
1) Do not post large pieces of code here - if you have a question about a particular SELECT statement, post only that statement and relevant data definitions. No one is going to read your whole program anyway - we have work to do too.
2) Your JOIN is way too big and would be difficult to analyze if anything goes wrong. You might want to start with smaller SELECTs and, when you're sure everything is working correctly, then combine them into one. Also huge JOINT is not necessarily more efficient.
3) You don't have to use aliases "AS a... AS b", etc. Instead, just use the table name, e.g. AFKO... AFPO... .It is much easier to read this way. The aliases are needed only if you're joining the same table more than once. Also they're not limited to one letter either. -
Data is not updating from DSO to CUBE
Hi Friends,
Can any one please Guide me.
Data is updating upto ODS but not from this lower level ODS to top of the cube from last week and displaying error as " Exception condition "DATE_INVALID" raised" .
How i can proceed to find which date field is getting wrong date or not getting date ..Can any body tell that how we can analize the possibilities in this case to find the error and solution .I need to solve this today,Can any body guide me please.
BR,
Venkathi
check the transformations between dso and cube, and check any inconsistence. if not then follow the link
http://www.consolut.com/en/s/sap-ides-access/d/s/doc/F-DATE_CONVERT_TO_FACTORYDATE
this may help you.
Maybe you are looking for
-
<i>Locking duplicate thread.<br>Please continue here: [[/questions/1056930]]</i> Dear reader, Since a week my firefox experiences strange image loading behavior. The problem is seen on various pages, in particular when there are more images/pictures
-
TREX 7.1 IIS logon failed http service start failed
TREX 7.1 Rev 36 wurde in folgender Systemumgebung installiert: Windows Server 2008 R2 Standard (64 Bit) Java: Sun JSE 1.4.2 64bit (1.4.2_25 Rev b02) Umgebungsvariablen JAVA_HOME=C:j2sdk1.4.2_25-x64 gesetzt bzw. PATH ergänzt um C:j2sdk1.4.2_25-x64jre
-
Giving parameter to spreport.sql in Sql plus worksheet
can any one please tell me how can we give value for the begining snap and ending snap to spreport in sql plus worksheet best regards asif
-
hello all, I'm a new user to final cut express hd, and I'm just curious, how does one add a title over a video file, as well as just a title in general
-
How can I send a website page by email with Firefox, not just the link?
I am unable to SEND web pages with Firefox. With Internet Explorer, I simply go to FILE - Send - Page by email, (or Link by email). By sending the page, I can add some comments, remove some advertising, and/or highlight points I would like to highlig