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: 

Subject length Problem

Former Member
0 Kudos
76

Hi,

I am using following code to send email through SAP .

  • Populate the subject/generic message attributes

gd_doc_data-obj_langu = sy-langu.

gd_doc_data-obj_name = 'SAPRPT'.

gd_doc_data-obj_descr = lv_body_sub.

gd_doc_data-sensitivty = 'F'.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = gd_doc_data

put_in_outbox = 'X'

sender_address = ld_sender_address

sender_address_type = ld_sender_address_type

commit_work = 'X'

IMPORTING

sent_to_all = gd_sent_all

TABLES

packing_list = it_packing_list

contents_txt = it_message

receivers = it_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.

But here, the subject length is very less(around 50).How can i increase the subject length?

Thanks.

3 REPLIES 3

Former Member
0 Kudos
50

Well, I don't like saying "It's not possible"... So, I will have to amend this to: "To my knowledge, it's not possible"...

As far as I know, the subject length is restricted. Even when using the BCS class to send mails. This is newer, but even there the length is restricted to 50...

0 Kudos
50

Hey E. Vleeshouwers ,

I am using the BCS Class method for sending email.

I am using the below code in side the code of BCS to increase the subject length to 255.

TRY.
                CALL METHOD lo_send_request->set_message_subject
                  EXPORTING
                    ip_subject = lv_body_sub.
              CATCH cx_sy_dyn_call_illegal_method.
            ENDTRY.

Now i am getting a Run time error saying:

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "LO_SEND_REQUEST").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

Kindly help.

0 Kudos
50

Hi,

Even if you use CL_BCS, subject still has a limit of 50 char.

Regards,

Steph