‎2010 Jul 20 10:51 AM
Please use a meaningful subject in future.
Hi all..i am new in abaq programming. there are some error which i found out and i need the help/guidance from sap expert here.
Here my question:
Besides of the field declare in it_sum, there are some field i need to take out fr itab for display out. when debug until create_fieldcat_coo, it_fieldcat just show out field i had declared earlier in it_sum and with 2 additional field which are keypart and funcpart. may i know what it mean for keypart and funcpart? how if i want it_fieldcat display the field from it_sum and itab?
thanks in advance!!
Here my code:
DATA: BEGIN OF it_sum OCCURS 0.
DATA: landx LIKE t005t-landx,
mtbez LIKE t134t-mtbez,
prdha LIKE mara-prdha,
knttp LIKE ekpo-knttp,
mtart LIKE mara-mtart.
INCLUDE STRUCTURE itab.
DATA: END OF it_sum.
DATA: BEGIN OF itab OCCURS 0,
mandt LIKE rbkp-mandt,
lifnr LIKE lfa1-lifnr, " vendor no
xblnr LIKE rbkp-xblnr, " inv no
matnr LIKE ekpo-matnr, " part no
ebeln LIKE rseg-ebeln, " order no
land1 LIKE lfa1-land1, " Vendor's Country SN001+
wemng LIKE ekbez-wemng, " rcv-qty
menge LIKE mseg-menge, " str-qty
uprice(9) TYPE p DECIMALS 4, " unit-price
waers LIKE rbkp-waers, " cur
wrbtr LIKE rseg-wrbtr, " amount
kursf LIKE rbkp-kursf, " rate
amount(9) TYPE p DECIMALS 2, " amount (m$)
gbudat LIKE ekbe-budat, " rcv date
sbudat LIKE mkpf-budat, " str date
belnr LIKE rbkp-belnr, " inv doc no
buzei LIKE rseg-buzei,
budat LIKE rbkp-budat, " Posting date
aedat LIKE ekko-aedat, " PO creation date
ebelp LIKE ekpo-ebelp,
netdt LIKE rbkp-budat, " Payment Due Date
fidoc LIKE rbkp-belnr, " FI Document No for Invoice
kursf_c(13),
END OF itab.
....
.....
.....
FORM create_fieldcat_coo.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_SUM'
i_inclname = 'zmmkrs001'
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " create_fieldcat_cooEdited by: Matt on Jul 20, 2010 12:23 PM - added tags
Edited by: Matt on Jul 21, 2010 9:43 AM - added warning
‎2010 Jul 20 11:07 AM
Hi Alicia
-- First use these corrections :
FORM create_fieldcat_coo.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_SUM'
i_inclname = 'zmmkrs001'
i_inclname = 'ZMMKRS001' <-- Always use uppercase characters
I_BYPASSING_BUFFER = 'X' <-- User this parameter to by pass buffer ( to get rid of the fields you early declared )
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " create_fieldcat_coo
-- "Key part" means that fields declared as key field in the database table of structure in se11
"function part" means that they are not key field
-- if you want to hide some fileds , you should set the column NO_OUT = 'X' for that field
in internal table it_fieldcat.
-- if you want fields of both it_sum and itab tables than call the function REUSE_ALV_FIELDCATALOG_MERGE twice
with parameter
i_internal_tabname = 'IT_SUM' and i_internal_tabname = 'ITAB''
I hope it helps
Bulent
‎2010 Jul 20 11:21 AM
hI
I changed but the problem still there. may i knw am i miss out anythings?
FORM create_fieldcat_coo.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_SUM'
i_inclname = 'ZMMKRS001'
I_BYPASSING_BUFFER = 'X'
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " create_fieldcat_coo
May i know what u mean for this??
-- if you want fields of both it_sum and itab tables than call the function REUSE_ALV_FIELDCATALOG_MERGE twice
with parameter
i_internal_tabname = 'IT_SUM' and i_internal_tabname = 'ITAB''
is it?
FORM create_fieldcat_coo.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_SUM' and i_internal_tabname = 'ITAB''
i_inclname = 'ZMMKRS001'
I_BYPASSING_BUFFER = 'X'
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " create_fieldcat_coo
‎2010 Jul 20 1:06 PM
Hi,
No I mean just write a subroutine that generates field catalog like this :
FORM create_fieldcat_coo
USING ip_table_name <-- with parameters
CHANGING ep_t_fieldcat TYPE SLIS_T_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = ip_table_name <-- your form parameter 1
i_inclname = 'ZMMKRS001'
I_BYPASSING_BUFFER = 'X'
CHANGING
ct_fieldcat = ep_t_fieldcat <-- your form parameter 2
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " create_fieldcat_coo
Now call this form twice :
PERFORM create_fieldcat_coo
USING 'IT_SUM'
CHANGING it_fieldcat1.
PERFORM create_fieldcat_coo
USING 'ITAB'
CHANGING it_fieldcat2.
Now you have two field catalogs for your two table,
now you can do whatever you want.
Can you explain your problem in detail?
‎2010 Jul 21 8:44 AM