SAP ABAP How to create double rule line in Smartforms print output using table line?
Working with SAP ABAP has been great and challenging. The euphoric feeling when the end user start using your program and they were awed by the output far beyond their imagination.
But sometimes, all those great achievements just turn into dust when they want a simple request, from their point of view, just a very simple request, and yet you could not deliver it.
Take for example the "Double Rule" in accounting reports, most specifically, the Financials Reports. FI Functional and end-user pushes that report should show the double rule line. In order to satisfy their needs, I just put '=' after printing the grand total.
Though it's okey for them, but on my part I still feel uneasy for not able to deliver what they want. The very simple request were unattainable!
After experimenting Smartforms, table lines and Smartstyle, Gotcha! I was able to find the solution or trick to able to show "double rule" in printing reports.
Here is my simple solution!
Step 1. On the Table, copy the table line of your total line. Here, I named it double_rule
Step 2. On the Main Area, create a table line and in the line type dropdown, select the Double_rule.
Step 3. In the Condition tab of the table line(double_rule), insert condition for the double_rule.
Step 4. Execute Tx Smartstyles. Create new entry in Paragraph formats and named it DR (Double Rule). In the FONT Tab, make the value for Font size to 4.0 pt.
Step 5. In the Indents and Spacing Tab, enter 0.30 pt in the Line Spacing. This will shrink the spacing between rows.
Step 6. Back to Smartforms, add TEXT on the first cell and select the "DR Double Rule" that was created in SmartStyle. Using the sample code below, test and run it to see the sample output.
The sample output.
Another sample output from customized Balance Sheet Report
And here is the code snippet...
*/---------------------------------------------------------------------
REPORT ZSF_DOUBLE_RULE.
Data: i_Rep Type table of ZPNL_ALV with header line.
START-OF-SELECTION.
Perform Load_Data.
Perform Print_Report.
END-OF-SELECTION.
*/============================================
*/---------------------------------------------------------------------
FORM Load_Data.
*/---------------------------------------------------------------------
REFRESH: i_Rep.
DEFINE add_data.
Clear: i_Rep.
i_Rep-SHKZG = &1. ""Row Indicator
i_Rep-DESC = &2.
i_Rep-ACT_MTD = &3.
APPEND i_Rep.
END-OF-DEFINITION.
add_data: 'D' 'Cash' '500.00',
'D' 'Receivables' '200.00',
'D' 'Inventories' '300.00',
'D' 'Prepayments' '400.00',
'T' 'Sub-Total' '1400.00',
'D' ' ' ' ',
'D' 'Property, plant and equipment' '200.00',
'D' 'Other assets' '300.00',
'D' 'Notes payable' '100.00',
'T' 'Sub-Total' '600.00',
'T' 'Grand Total' '2000.00',
'X' ' ' ' '. ""Indicator for double rule line
ENDFORM. ""End of Load_Data
*/============================================
*/---------------------------------------------------------------------
FORM Print_Report.
*/---------------------------------------------------------------------
Data smartform_fx type rs38l_fnam.
Data lv_ssfcompop type ssfcompop.
lv_ssfcompop-tddest = 'LOCL'.
lv_ssfcompop-tdimmed = 'X'.
lv_ssfcompop-tddelete = 'X'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSF_TEST_DOUBLE_RULE'
IMPORTING
fm_name = smartform_fx
EXCEPTIONS
no_form = 1
no_function_module = 2
others = 3.
CALL FUNCTION smartform_fx
EXPORTING
output_options = lv_ssfcompop
user_settings = space
Tables
i_Rep = i_Rep
Exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
ENDFORM. ""End of Print_Report
*/===========================================
Mabuhay, Philippines!
It worked! Why SAP won't create as simple solution for a simple problem... diba?
ReplyDelete