cancel
Showing results for 
Search instead for 
Did you mean: 

Show Multiple Internal tables in a Smartform

Former Member
0 Kudos

HI All,

I have a business requirement where i need to display data from 4 different internal tables into a Single Smartform.

I am converting this Smartform into a PDF and displaying it to the user.

My problem is that when there is no data filled, the smartform works fine.

But when u fill the data, the Smartform gives Formatting Error.

I am using a Smartstyle with Font of 5, Portrait type output.

Any clue why thsi formatting error comes???

When i debug i find out that it gives sy-subrc = 1.

Perform UCFMET_CHARWIDTH_UCIX

  • get width of a single char passing the INTEGER codepoint

form UCFMET_CHARWIDTH_UCIX using ucix type i

width type i.

statics: foundrange,

ucchar type scpuchar,

columns type i.

read table ucfmet_chartab with key ucix = ucix binary search.

if sy-subrc = 0. "its a single char

width = ucfmet_chartab-width.

else. "check ranges...

clear foundrange.

loop at ucfmet_rangetab where ucix_start <= ucix

and ucix_end >= ucix.

foundrange = 'X'. width = ucfmet_rangetab-width.

endloop.

if foundrange = 'X'.

sy-subrc = 0.

else.

if ucfmet_metrics_type = c_metrics_uc.

  • to prevent # in Chinese, check for doublewidth range

clear foundrange.

loop at ucfmet_dbwidth_rangetab where ucix_start <= ucix

and ucix_end >= ucix.

foundrange = 'X'.

endloop.

if foundrange = 'X'.

width = ucfmet_han_doublewidth.

sy-subrc = 0.

else.

sy-subrc = 1.

endif.

elseif ucfmet_metrics_type = c_metrics_sap.

  • for old fontmetrics, check for missed wide CJK chars

perform get_visual_charlen using ucchar ucix columns.

if columns = 2. "Asian CJK

width = ucfmet_cjk_doublewidth.

sy-subrc = 0.

else.

sy-subrc = 1.

endif.

else.

sy-subrc = 1.

endif.

endif.

endif.

endform.

IN the coding in the bold, the value of columns always comes 1. and hence the sy-subrc 1.

Can anyone help me in understanding what the issue is???

I have a single smartform.

I have created 4 table structures.

Each one has a different line type.

all 4 tables are associtaed to a single main window.

Thanks and Regards

Gaurav Raghav

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor
0 Kudos

I don't see why you think the error comes from the multiple internal tables. Here the error comes from a field (maybe it's related to character encoding; could you test by filling only with occidental characters, digits for example). You may get which field it is about using SFTRACE transaction (see [sap library - smartform trace|http://help.sap.com/saphelp_nw70/helpdata/EN/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm]).

Former Member
0 Kudos

Hi Sandra,

Thanks a lot for the SFTRACE transaction.

That made me realize me ultoimate stupidity.

I was passing reference fields for only 1 of the 3 internal tables and hence the formatting error.

With the SFTRACE, i found that the reference field was missing.

Points are awarded.

Thanks and Regards

Gaurav Kumar Raghav

Answers (0)