Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what is the purpose and use of SX_TABLE_LINE_WIDTH_CHANGE function module?

Balu483
Participant
0 Kudos

hi friends,

i have a million  dollar question .i.e

what is the use of this SX_TABLE_LINE_WIDTH_CHANGE function module .

and how to use this function module?

thanks&regards,

balu.

1 ACCEPTED SOLUTION

former_member186660
Participant

Good day Chandu,

We used the FM to convert the pdf data into an attachment to sent via e-mail address from SAP.

Data :

         lt_pdfdata         TYPE TABLE OF tline,

        lt_pdf               TYPE TABLE OF solisti1, "E-mall attachment type

Call FM :  SSF_FUNCTION_MODULE_NAME


"Call Smartform function module.

CALL FUNCTION fm_name


"Convert smart to PDF

CALL FUNCTION 'CONVERT_OTF'

   EXPORTING

     format                = 'PDF'

   IMPORTING

     bin_filesize          = bin_filesize

   TABLES

     otf                   = lt_otf_final

     lines                 = lt_pdfdata[]

   EXCEPTIONS

     err_max_linewidth     = 1

     err_format            = 2

     err_conv_not_possible = 3

     err_bad_otf           = 4

     OTHERS                = 5.


"Now here the pdf might be too big, so we supress or shrink with

CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'

             "EXPORTING

               "line_width_dst              = '255'

             TABLES

               content_in                  lt_pdfdata[] " From FM Convert_otf

               content_out                 = lt_pdf[]  "E-mail attachment

             EXCEPTIONS

               err_line_width_src_too_long = 1

               err_line_width_dst_too_long = 2

               err_conv_failed             = 3

               OTHERS                      = 4.


"Function module to send mail to Recipients

             CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

               EXPORTING

                 document_data              = w_document_data

                 put_in_outbox                = 'X'

                 commit_work                = 'X'

               IMPORTING

                 sent_to_all                  = g_sent_to_all

               TABLES

                 packing_list               = lt_packing_list

                 contents_bin               = lt_pdf

                 contents_txt               = lt_body_msg

                 receivers                  = lt_receivers

               EXCEPTIONS

                 too_many_receivers         = 1

                 document_not_sent          = 2

                 document_type_not_exist    = 3

                 operation_no_authorization = 4

                 parameter_error            = 5

                 x_error                    = 6

                 enqueue_error              = 7

                 OTHERS                     = 8.



Regards,

Tumelo Modise

2 REPLIES 2

former_member186660
Participant

Good day Chandu,

We used the FM to convert the pdf data into an attachment to sent via e-mail address from SAP.

Data :

         lt_pdfdata         TYPE TABLE OF tline,

        lt_pdf               TYPE TABLE OF solisti1, "E-mall attachment type

Call FM :  SSF_FUNCTION_MODULE_NAME


"Call Smartform function module.

CALL FUNCTION fm_name


"Convert smart to PDF

CALL FUNCTION 'CONVERT_OTF'

   EXPORTING

     format                = 'PDF'

   IMPORTING

     bin_filesize          = bin_filesize

   TABLES

     otf                   = lt_otf_final

     lines                 = lt_pdfdata[]

   EXCEPTIONS

     err_max_linewidth     = 1

     err_format            = 2

     err_conv_not_possible = 3

     err_bad_otf           = 4

     OTHERS                = 5.


"Now here the pdf might be too big, so we supress or shrink with

CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'

             "EXPORTING

               "line_width_dst              = '255'

             TABLES

               content_in                  lt_pdfdata[] " From FM Convert_otf

               content_out                 = lt_pdf[]  "E-mail attachment

             EXCEPTIONS

               err_line_width_src_too_long = 1

               err_line_width_dst_too_long = 2

               err_conv_failed             = 3

               OTHERS                      = 4.


"Function module to send mail to Recipients

             CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

               EXPORTING

                 document_data              = w_document_data

                 put_in_outbox                = 'X'

                 commit_work                = 'X'

               IMPORTING

                 sent_to_all                  = g_sent_to_all

               TABLES

                 packing_list               = lt_packing_list

                 contents_bin               = lt_pdf

                 contents_txt               = lt_body_msg

                 receivers                  = lt_receivers

               EXCEPTIONS

                 too_many_receivers         = 1

                 document_not_sent          = 2

                 document_type_not_exist    = 3

                 operation_no_authorization = 4

                 parameter_error            = 5

                 x_error                    = 6

                 enqueue_error              = 7

                 OTHERS                     = 8.



Regards,

Tumelo Modise

Former Member
0 Kudos

Convert TLINE type data to SOLIX type data