‎2010 Jul 21 9:51 AM
Dear All:
i want to generate a withholding tax report with following format. i populated two internal tables for vendor information and withholding tax information. but cannot bring the format like this:
Vendor 10000012 Vendor Name ABC Traders
Document No Document Date Posting Date Withholding Tax Code Withholding Tax Base Amount Withholding Tax Amount
50000010 12.06.2010 12.06.2010 A2 10000 100
50000011 17.06.2010 17.06.2010 A5 42500 425
50000012 28.06.2010 28.06.2010 A5 81569 815.69
can anyone help me how i can generate this format? can anyone provide me any sample code for that?
‎2010 Jul 21 10:01 AM
Hi
Generally the order of fields in the alv report is same as that of the internal table.If you want to have your specific order then you need to make your own field catalog.
Sample code:
FORM BUILD_FIELDCATALOG.
WA_FIELDCATALOG-TABNAME = 'Y78EMP'.
WA_FIELDCATALOG-FIELDNAME = 'EMP_ID'.
WA_FIELDCATALOG-COL_POS = '1'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
WA_FIELDCATALOG-FIELDNAME = 'LAST_NAME'.
WA_FIELDCATALOG-COL_POS = '2'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
WA_FIELDCATALOG-FIELDNAME = 'FIRST_NAME'.
WA_FIELDCATALOG-COL_POS = '3'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR WA_FIELDCATALOG.
ENDFORM.
Col_pos parameter of the fiield catalog gives the column position.
And you need to pass the this field catalog name in the IT_FIELDCAT parameter of REUSE_ALV_GRID_DISPLAY
Thanks!!
Edited by: Rahuljn on Jul 21, 2010 3:23 PM
‎2010 Jul 21 10:01 AM
Hi
Generally the order of fields in the alv report is same as that of the internal table.If you want to have your specific order then you need to make your own field catalog.
Sample code:
FORM BUILD_FIELDCATALOG.
WA_FIELDCATALOG-TABNAME = 'Y78EMP'.
WA_FIELDCATALOG-FIELDNAME = 'EMP_ID'.
WA_FIELDCATALOG-COL_POS = '1'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
WA_FIELDCATALOG-FIELDNAME = 'LAST_NAME'.
WA_FIELDCATALOG-COL_POS = '2'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
WA_FIELDCATALOG-FIELDNAME = 'FIRST_NAME'.
WA_FIELDCATALOG-COL_POS = '3'.
APPEND WA_FIELDCATALOG TO FIELDCATALOG.
CLEAR WA_FIELDCATALOG.
ENDFORM.
Col_pos parameter of the fiield catalog gives the column position.
And you need to pass the this field catalog name in the IT_FIELDCAT parameter of REUSE_ALV_GRID_DISPLAY
Thanks!!
Edited by: Rahuljn on Jul 21, 2010 3:23 PM
‎2010 Jul 21 10:13 AM
Hi,
Check the examples provided in SAP itself.
Tcode - SE38 ---> BCALV_TEST_HIERSEQ_LIST
And also check other programs with BCALV*