08-05-2014 10:32 AM
Dear All,
I have developed a z report . i want to add one more filed (Chapter id ). My report is working fine but chapter id data is not getting
Please find a attached my code and correct and reply ASAP.
Thanks in Advance
Richa
08-05-2014 10:51 AM
Hi Richa,
SELECT * FROM J_1ICHIDTX
INTO TABLE IT_DES
FOR ALL ENTRIES IN IT_CHPID
WHERE J_1ICHID EQ IT_CHPID-J_1ICHID
AND LANGU EQ SY-LANGU.
debug and check the content is filled in IT_DES .
Regards,
Venkat.
08-05-2014 10:51 AM
Hello Richa,
Please change the column position in Form Fcat.
FCAT-COL_POS = '1'.
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'AUFNR' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Order Number'.
APPEND FCAT .
FCAT-COL_POS = '2'.
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'J_1ICHID' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Chapter ID'.
APPEND FCAT .
FCAT-COL_POS = '2'. "--->change to 3
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'DES' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Chap.Description'.
APPEND FCAT .
FCAT-COL_POS = '2'. "--->change to 4
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'GSTRP1' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Start Dt'.
APPEND FCAT .
Thanks
08-05-2014 10:56 AM
Dear Always,
Thanks for the response..!!
This is typing mistake i am already modify this mistake .
08-05-2014 10:51 AM
Hi Richa,
SELECT * FROM J_1ICHIDTX
INTO TABLE IT_DES
FOR ALL ENTRIES IN IT_CHPID
WHERE J_1ICHID EQ IT_CHPID-J_1ICHID
AND LANGU EQ SY-LANGU.
debug and check the content is filled in IT_DES .
Regards,
Venkat.
08-05-2014 11:04 AM
Dear Venkat,
After updated this code in my report
debug and check the content is filled in IT_DES showing the same..
Regards
Richa
08-05-2014 11:16 AM
Hi Richa,
Execute this coding and check it.
CLEAR : AMT .
LOOP AT ITAB2.
LOOP AT IT_MSEG WHERE AUFNR = ITAB2-AUFNR AND
BWART = '101' .
READ TABLE ITAB WITH KEY IGMNG = ITAB2-IGMNG.
MOVE ITAB-IGMNG TO ITAB2-IGMNG.
AMT = ITAB2-IGMNG.
READ TABLE it_chpid INTO WA_CHPID WITH KEY MATNR = IT_MSEG-MATNR.
IF SY-SUBRC EQ 0.
READ TABLE IT_DES INTO WA_DES WITH KEY J_1ICHID = WA_CHPID-J_1ICHID.
IF SY-SUBRC EQ 0.
ITAB2-J_1ICHID = WA_DES-J_1ICHID.
ITAB2-DES = WA_DES-J_1ICHT1.
ENDIF.
ENDIF.
MODIFY ITAB2.
ENDLOOP.
READ TABLE it_chpid INTO WA_CHPID WITH KEY MATNR = ITAB2-MATNR.
IF SY-SUBRC EQ 0.
READ TABLE IT_DES INTO WA_DES WITH KEY J_1ICHID = WA_CHPID-J_1ICHID.
IF SY-SUBRC EQ 0.
ITAB2-J_1ICHID = WA_DES-J_1ICHID.
ITAB2-DES = WA_DES-J_1ICHT1.
ENDIF.
MODIFY ITAB2.
CLEAR : ITAB2 , AMT , AMT2.
ENDLOOP.
Regards,
Venkat.
08-05-2014 11:43 AM
Dear Venkat,
Thanks for the response..!!
After add this code. report is going to Run time error
Regards
Richa
08-05-2014 11:48 AM
Hi Richa,
Know i altered ths coding,check it,
if it is not getting values, paste the error.
Execute this coding and check it.
CLEAR : AMT .
LOOP AT ITAB2.
LOOP AT IT_MSEG WHERE AUFNR = ITAB2-AUFNR AND
BWART = '101' .
READ TABLE ITAB WITH KEY IGMNG = ITAB2-IGMNG.
MOVE ITAB-IGMNG TO ITAB2-IGMNG.
AMT = ITAB2-IGMNG.
READ TABLE it_chpid INTO WA_CHPID WITH KEY MATNR = IT_MSEG-MATNR.
IF SY-SUBRC EQ 0.
READ TABLE IT_DES INTO WA_DES WITH KEY J_1ICHID = WA_CHPID-J_1ICHID.
IF SY-SUBRC EQ 0.
ITAB2-J_1ICHID = WA_DES-J_1ICHID.
ITAB2-DES = WA_DES-J_1ICHT1.
ENDIF.
ENDIF.
MODIFY ITAB2.
ENDLOOP.
ENDLOOP.
Regards,
Venkat.
08-05-2014 12:04 PM
Dear Venkat,
Thanks for the response..!!
After add this code. report is going to Run time error
Please find a attached screen shot..!!
08-05-2014 12:16 PM
Hi Richa,
problem is in your field cataloge,
Check it ,if not send your modified fieldcataloge.
Regards,
Venkat.
08-05-2014 12:27 PM
Dear Venkat,
Please check my field catalogue
FORM FCAT .
DATA: TF TYPE C.
PERFORM SUB_USER_IS USING TF.
FCAT-COL_POS = '1'.
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'AUFNR' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Order Number'.
APPEND FCAT .
FCAT-COL_POS = '2'.
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = ' J_1ICHID' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Chapter ID'.
APPEND FCAT .
FCAT-COL_POS = '3'.
FCAT-TABNAME = 'ITAB2'.
FCAT-FIELDNAME = 'DES' .
FCAT-OUTPUTLEN = '10'.
FCAT-SELTEXT_L = 'Chap.Description'.
APPEND FCAT .
After change my Filed catalogue report is running but data not getting. please check my screen shot
Regards,
Richa
08-05-2014 12:40 PM
Hi Richa,
If i am wrong reply me,
actually you are appending itab2 after this select query only, so it will not come inside the loop.
IF ITAB2[] IS NOT INITIAL. "Comment this
if IT_MSEG[] IS NOT INITIAL. "Add this
SELECT MATNR
J_1ICHID FROM J_1IMTCHID
INTO TABLE IT_CHPID
FOR ALL ENTRIES IN it_mseg
WHERE MATNR EQ it_mseg-MATNR.
endif.
IF IT_CHPID[] IS NOT INITIAL.
SELECT * FROM J_1ICHIDTX
INTO TABLE IT_DES
FOR ALL ENTRIES IN IT_CHPID
WHERE J_1ICHID EQ IT_CHPID-J_1ICHID.
ENDIF.
Regards,
Venkat.
08-05-2014 1:08 PM
08-05-2014 11:34 AM
Hi,
Your ITAB2 is having no Data at this place, also check for
IF ITAB2[] IS NOT INITIAL.
SELECT MATNR
J_1ICHID FROM J_1IMTCHID
INTO TABLE IT_CHPID
FOR ALL ENTRIES IN ITAB2 -----------> may be IT-MSEG or GIT_MARA
WHERE MATNR EQ ITAB2-MATNR.
endif.
Comment FCAT-COL_POS = Option in your field Catalogue
Regards
08-05-2014 12:37 PM
Dear Somendra,
Thanks for the Response..!!
You have checked my code?? If you have getting correct error Please help my because i am new abaper. i don't have excellent knowledge ..!!
Regards,
Richa
08-05-2014 12:58 PM
hi ,
In debug have u checked ITAB2 is updating Chapter id & Des is updating or not .
CLEAR : AMT .
LOOP AT ITAB2.
LOOP AT IT_MSEG WHERE AUFNR = ITAB2-AUFNR AND
BWART = '101' .
READ TABLE it_chpid INTO WA_CHPID WITH KEY MATNR = ITAB2-MATNR.
IF SY-SUBRC EQ 0.
READ TABLE IT_DES INTO WA_DES WITH KEY J_1ICHID = WA_CHPID-J_1ICHID.
IF SY-SUBRC EQ 0.
ITAB2-J_1ICHID = WA_DES-J_1ICHID.
ITAB2-DES = WA_DES-J_1ICHT1.
ENDIF.
ENDIF.
*======================================================================== " end by Richa
MODIFY ITAB2.
ENDLOOP.
MODIFY ITAB2.
CLEAR : ITAB2 , AMT , AMT2.
ENDLOOP.