2022 Apr 18 12:42 PM
Hello Experts,
Here i am requesting for all of you please suggest how can i send dynamic subject in the given code here under for auto generated mail in ABAP:-
CALL METHOD CL_DOCUMENT_BCS=>CREATE_DOCUMENT
EXPORTING
I_TYPE = 'TXT'
I_SUBJECT = 'TOWN LOSS FOR THE MONTH OF'
I_TEXT = lt_body
RECEIVING
RESULT = DATA(lo_doc).
At above code i want that the 'TOWN LOSS FOR THE MONTH OF' should be changed as per table data.
Thanks in advance for the best solution.
2022 Apr 18 2:17 PM
2022 Apr 19 10:08 AM
Why are you using the old syntax. What's wrong with
DATA(doc) = cl_document_bcs=>create_document( i_type = 'TXT'
i_subject = 'TOWN LOSS FOR THE MONTH OF'
i_text = body ).
2022 Apr 20 1:11 PM
I am new in ABAP, that why i am using this syntax. In place of 'TOWN LOSS FOR THE MONTH OF' I want to use table data like :-
1.i_subject = 2022 after one year this should be
i_subject = 2023.
2022 Apr 20 1:15 PM
Could you clarify what is l_i_subject ? and if this title is hard coded or have a dynamic part ?
2022 Apr 20 2:09 PM
Hello,
I don't understand where is the difficulty ! 🙂
use a variable as
lv_subject type SO_OBJ_DES.
populate it, example with
lv_subject = sy-datum(4).
And set this variable to method parameters i_subject...
No ?
2022 Apr 20 3:02 PM
DATA(lo_doc) = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = 'TXT'
I_SUBJECT = |TOWN LOSS FOR THE MONTH OF { sy-datum(4) }|
I_TEXT = lt_body ).
2022 Apr 21 8:13 AM
Thank You so much Sandra Rossi !! SAP Community is wonderful platform where we can hope for the best solution.
Thanks once again. Respected All who contribute for solving/suggesting me to solve the problem.