Text creation in BAPI_ACTIVITYCRM_CREATEMULTI
Hi,
I am not able to add notes with the activity created using FM :
BAPI_ACTIVITYCRM_CREATEMULTI . I am writing the below code:
* Set Text
wa_text_bapi-ref_guid = wa_activity-zcrm_guid. " having the header GUID
wa_text_bapi-ref_handle = '0000000001'.
wa_text_bapi-REF_KIND = 'A'.
wa_text_bapi-tdid = 'A001'.
wa_text_bapi-tdspras = sy-langu.
wa_text_bapi-tdline = wa_raw_act-description. "having the notes values
wa_text_bapi-tdstyle = 'SYSTEM'.
wa_text_bapi-tdform = 'SYSTEM'.
wa_text_bapi-mode = 'A'. "guess
wa_text_bapi-tdformat = '*'.
append wa_text_bapi to lt_text_bapi.
wa_text_bapix-ref_guid = 'X'.
wa_text_bapix-ref_handle = 'X'.
wa_text_bapix-REF_KIND = 'X'.
wa_text_bapix-tdid = 'X'..
wa_text_bapix-tdspras = 'X'.
wa_text_bapix-tdline = 'X'.
wa_text_bapix-tdstyle = 'X'.
wa_text_bapix-tdform = 'X'.
wa_text_bapix-mode = 'X'.
wa_text_bapix-tdformat = 'X'.
append wa_text_bapix to lt_text_bapix.
CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'
TABLES
header = it_activity_bapi
headerx = it_activity_bapix
TEXT = lt_text_bapi
TEXTX = lt_text_bapix
STATUS = lt_status_bapi
STATUSX = lt_status_bapix
document_flow = lt_docflow_bapi
journal = lt_journal_bapi
journalx = lt_journal_bapix
material = lt_material_bapi
materialx = lt_material_bapix
extensionin = lt_extensionin
created_process = lt_created_header
return = lt_return2.
But the text is not getting added to the notes .
Please help.
thanks,
Mansi
Hi Mansi,
Everything seems fine, so I really don't have much to say, but let me just share with you three thoughts:
- If you're filling the ref_guid, you don't need to fill the ref_handle (and vice-versa).
- Can you confirm the text ID is A001? Just saying this because the 'notes' text in my system for standard Interaction Record text profile, is A002.
- If still don't work, you can try to consider creating the activity using FM CRM_MA_ACT_SAVE.
Kind regards,
Garcia
Similar Messages
-
Long Text creation of Delivery using DELVRY03
Hi Gurus,
I'm using Delvry03 basic type to create ASN in SAP. It is an Inbound processing. Here the problem as I'm not able to create HEADER text's using the segment E1TXTH8. wghen i try to create using SAVE_Text function module texts are getting created, Also i didn't find any E1TXTH8 realated code in the inbound function module idoc_input_delvry. is there any way to create header text without going for user-exits.
Thanks&Regards,
Naren.hi naren,
to say in detail about ur doubt i need ur code.u can send ur code to my mail-id [email protected] -
Operation Long text creation problem in IW32
Hi experts,
I have a requirement of showing a checklist pop up for all the new external operations in creating a MPA work order(IW32). And when the user answers the questions on the checklist, I have to copy all the questions and answers into the long text of the corresponding operation.
The problem here is,
for a case when the long text is not yet created for a new line item, when the pop up is shown and answers are filled, I am creating a new standard text using SVE_TEXT(setting the insert paramter 'X'), but the standard text is getting created in the database i.e a record is getting created in STXH with the text id, text name, text object of the operation. But when I go to IW32 and see the operation line it shows the create long text icon which says that the text is not created at all.
In a case where the long text is already created for the operation, and then the pop up is shown with the questions and answers are filled, the questions and answers are copied into the operation long text which is already created. So this works fine.
If any pointers regarding this please let me know.
Thanks and Regards,
AshaHi,
Try passing SAVEMODE_DIRECT = 'X' and check..
also check if the text exists using the function module READ_TEXT once you do the SAVE_TEXT..
Thanks,
Naren -
Long text creation in custom screens
Hi
Can we add the functionality of adding a long text in the custom screen.
The long text should be same as the one which SAP provides in standard transactions.
If possible please tell me the solution.
Thanks & Regards
KapilHI,
yes you can add using TEXT AREA control here is the sample code.
insert a custom control area in the screen and create a object of the text editor.
check this code for PBO and PAI.
here TEDITOR is the custom contorl area name on screen
<b>MODULE PBO OUTPUT.
IF EDITOR IS INITIAL.
* set status
SET pf-status '1111'.
* create control container
CREATE OBJECT TextEdit_Custom_Container
EXPORTING
CONTAINER_NAME = 'TEDITOR'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
if sy-subrc ne 0.
* add your handling
ENDif.
mycontainer = 'TEDITOR'.
* create calls constructor, which initializes, creats and links
* TextEdit Control
create object editor
exporting
parent = TextEdit_Custom_Container
WORDWRAP_MODE =
* cl_gui_textedit=>wordwrap_off
cl_gui_textedit=>wordwrap_at_fixed_position
* cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER
WORDWRAP_POSITION = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
* to handle different containers
container_linked = 1.
refresh mytable.
ENDIF.
ENDMODULE. " PBO OUTPUT
MODULE pai INPUT.
case ok_code.
WHEN 'SAVE'.
* retrieve table from control
clear: txt.
call method editor->get_text_as_r3table
importing table = mytable.
loop at mytable into wa.
concatenate txt wa into txt
separated by '|'.
endloop.
shift txt left.
length = strlen( txt ).
ztext-CLUSTR = length.
ztext-text = txt.
modify ztext.
clear: ztext.
refresh: mytable.
call method editor->set_text_as_r3table
exporting table = mytable.
Message s000(zwa).
when 'DISP'.
select single * from
ztext
where fund = ztext-fund.
SPLIT ztext-text AT '|' INTO TABLE mytable.
call method editor->set_text_as_r3table
exporting table = mytable.
endcase.
clear: ok_code.
ENDMODULE. " pai INPUT</b>
Regards,
Wasim Ahmed -
Hi Experts,
I have a requirement to create the standard text in English and french for Quote text .
i know we use SO10 transaction.
Please explain the complete process step by step.
Thanks in advance,
MKHi,
goto SO10 Tcode
enter some Textname (parameter name)
Default ID will be ST for stanard texts
create the text and save it
You can read this text using the fun module READ_TEXT
and call the same text in the script using INCLUDE command
sample like
/: INCLUDE &T166K-TXNAM& OBJECT &T166K-TDOBJECT& ID &T166K-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH AS
Regards,
Omkaram. -
Upload Purchase order text using BDC while updating Material Master MM02
Hi All,
Please help me out with sample code upload PO Txt ( long text...which is more than 72 chars)using MM02. Its very urgent
I am not able to pass data into following fields seen in recording,
RSTXT-TXLINE(02),
RSTXT-TXLINE(03),
RSTXT-TXLINE(04),
RSTXT-TXLINE(05), as we can see only RSTXT-TXLINE field in the RSTXT structure......
how to split the long text into 72 chrs each and pass into data into the RSTXT-TXLINE(02), RSTXT-TXLINE(03), RSTXT-TXLINE(04)....correspondingly........
Thanks in advance.....
Reagards,
Prasad KR.Hi
see the sample program
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text1 LIKE tline-tdline, " Long Text
text2 LIKE tline-tdline, " Long Text
text3 LIKE tline-tdline, " Long Text
text4 LIKE tline-tdline, " Long Text
text5 LIKE tline-tdline, " Long Text
text6 LIKE tline-tdline, " Long Text
text7 LIKE tline-tdline, " Long Text
text8 LIKE tline-tdline, " Long Text
text9 LIKE tline-tdline, " Long Text
text10 LIKE tline-tdline, " Long Text
text11 LIKE tline-tdline, " Long Text
text12 LIKE tline-tdline, " Long Text
text13 LIKE tline-tdline, " Long Text
text14 LIKE tline-tdline, " Long Text
text15 LIKE tline-tdline, " Long Text
text16 LIKE tline-tdline, " Long Text
text17 LIKE tline-tdline, " Long Text
text18 LIKE tline-tdline, " Long Text
text19 LIKE tline-tdline, " Long Text
text20 LIKE tline-tdline, " Long Text
text21 LIKE tline-tdline, " Long Text
text22 LIKE tline-tdline, " Long Text
text23 LIKE tline-tdline, " Long Text
text24 LIKE tline-tdline, " Long Text
text25 LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text25 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text25.
APPEND itab.
ENDIF.
IF itab1-text24 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text24.
APPEND itab.
ENDIF.
IF itab1-text23 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text23.
APPEND itab.
ENDIF.
IF itab1-text22 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text22.
APPEND itab.
ENDIF.
IF itab1-text21 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text21.
APPEND itab.
ENDIF.
IF itab1-text20 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text20.
APPEND itab.
ENDIF.
IF itab1-text19 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text19.
APPEND itab.
ENDIF.
IF itab1-text18 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text18.
APPEND itab.
ENDIF.
IF itab1-text17 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text17.
APPEND itab.
ENDIF.
IF itab1-text16 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text16.
APPEND itab.
ENDIF.
IF itab1-text15 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text15.
APPEND itab.
ENDIF.
IF itab1-text14 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text14.
APPEND itab.
ENDIF.
IF itab1-text13 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text13.
APPEND itab.
ENDIF.
IF itab1-text12 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text12.
APPEND itab.
ENDIF.
IF itab1-text11 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text11.
APPEND itab.
ENDIF.
IF itab1-text10 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text10.
APPEND itab.
ENDIF.
IF itab1-text9 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text9.
APPEND itab.
ENDIF.
IF itab1-text8 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text8.
APPEND itab.
ENDIF.
IF itab1-text7 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text7.
APPEND itab.
ENDIF.
IF itab1-text6 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text6.
APPEND itab.
ENDIF.
IF itab1-text5 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text5.
APPEND itab.
ENDIF.
IF itab1-text4 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text4.
APPEND itab.
ENDIF.
IF itab1-text3 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text3.
APPEND itab.
ENDIF.
IF itab1-text2 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text2.
APPEND itab.
ENDIF.
IF itab1-text1 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text1.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
Reward points for useful Answers
Regards
Anji -
Im finding acrobat pro 10 incredibly frustrating and unintuitive. This is whats happening. I have created a pdf to which I need to add a page of text. I choose - add or edit text box in tools. Then the typewriter bar appears so I click on the typewriter and begin typing. Then I click out of the text box but when I go back to begin typing again I cannot. If I click on it again to try and aline cursor where I left off to begin typing again nothing happens. Instead a blue outline goes around the whole thing. I have tried with edit doc text and with edit text box. If I click a few times it will just start a new text box which I do not want. I just want to do a simple word doc . How hard can it be??? perhaps I should go back to using office. Please help, Im desperate to finish this project.
I would highly recommend you do text creation & editing in Word. Acrobat is indeed not designed for this. It does offer tools that do limited adding of text or editing of text, but this is not the purpose of the application.
As a potential fix for your current issue, after entering text with the Typewriter tool you can edit it by clicking Tools (on the right) > Content and go back to the Add or Edit Text box tool. You will see a blue border around your text, when you go to edit, double click somewhere in the middle of the blue box. Double clicking at the beginning or end may inadvertently add a new text area. -
How to add long text in bdc for transaction fb01 ?
IN the existing program of bdc fb01
i have to add a long text field
but it gets stuck while i process in sm35
is there a fm to add the field directly
thanks in a advanceHi
You can upload the Long texts separately into the transaction using the CREATE_TEXT fun module
Need to pass the correct parameters like OBJECT,ID, OBJECTNAME and LANGuage with the proper declarations.
see the sample code and do accordingly
REPORT zmm_longtext_sm
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Description : This Program is used to Upload the Service Master
: Long Texts using the Fun Module CREATE_TEXT
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
asnum like asmd-asnum, " Service No
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras. " Language
Constants
CONSTANTS:
Object ID for Long Text of Service Master
c_best TYPE thead-tdid VALUE 'LTXT',
c_material TYPE thead-tdobject VALUE 'ASMD'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
Upload the Texts
SORT itab BY asnum.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
concatenate '00000000000' itab-asnum into dl_name.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Service No'(001),
itab-asnum.
ELSE.
WRITE:/ 'Long Text Created Successfully for Service No'(002),
itab-asnum.
ENDIF.
AT END OF asnum.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
<b>Reward points for useful Answers</b>
Regards
Anji -
Get the sales order text from ITS and save it in SAP.
Hi,
I have created an application to create sales order from ITS. In this app i'm having a text field to fet the header text for the order. & after that I'm calling an RFC which has a BAPI to create the sales order.
Now, when i enter the text for header texts in frontend (separated by ENTER), then it saves only the first line of the text.
I've tried using :
SPLIT ordernotes AT cl_abap_char_utilities=>cr_lf INTO TABLE t_ordnotes.
and using FM: CREATE_TEXT,
but still, it is saving only the first line.
Can anyone please help me with this ?????
Its urgent.
Thanks in advance,
Hemant.Hi
See the sample BDC program that is used to upload the Material LONG Texts into SAP using MM01 Tcode
check this may be helpful
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
<b>Reward points for useful Answers</b>
Regards
Anji -
BDC - MM02 _long text for material PO upload
Hi experts,
I want to upload Long text for material PO in MM02 (Purchase order text view)
throuh BDC upload. I have successfully done recording for this transaction. But in the recording it show no table field for that particular long text.
Pls help me to do this issue.
Thanks.Hi
See the sample program for this and modify as per your requirement.
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text1 LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text1 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text1.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
<b>Reward points for useful Answers</b>
Regards
Anji -
How to pass header text in bapi for sale order
hai to all
i am using BAPI_SALESORDER_CREATEFROMDAT2 to create sale order
i can find order_text in tables parameters for creating item texts
but in my senario i have to maintain header text
please advice me how to proceed
rgds
vijayHi Vijay,
As I mentioned <b>it is very much possible to create sales order header text with this BAPI only</b>.
Just check out following working code:
REPORT yab_testso .
DATA: orderheaderin LIKE bapisdhd1,
orderitem TYPE TABLE OF bapisditm,
wa_orderitem TYPE bapisditm,
orderitemx TYPE TABLE OF bapisditmx,
wa_orderitemx TYPE bapisditmx,
orderpart TYPE TABLE OF bapiparnr,
wa_orderpartner TYPE bapiparnr,
ordertext TYPE TABLE OF bapisdtext,
wa_text TYPE bapisdtext,
orderret TYPE TABLE OF bapiret2,
wa_ret TYPE bapiret2,
lv_lines type i.
orderheaderin-doc_type = 'ZZOR'.
orderheaderin-sales_org = 'SS01'.
orderheaderin-distr_chan = 'SH'.
orderheaderin-division = 'ST'.
wa_orderpartner-partn_role = 'SP'.
wa_orderpartner-partn_numb = '1000000342'.
APPEND wa_orderpartner TO orderpart.
wa_orderpartner-partn_role = 'WE'.
wa_orderpartner-partn_numb = '1000000342'.
APPEND wa_orderpartner TO orderpart.
wa_orderitem-itm_number = '10'.
wa_orderitem-material = '000000111000000185'.
wa_orderitem-target_qty = '10'.
APPEND wa_orderitem TO orderitem.
wa_text-text_id = '0012'.
wa_text-langu = 'E'.
wa_text-text_line = 'Test for text creation'.
APPEND wa_text TO ordertext.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
order_header_in = orderheaderin
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT =
TABLES
return = orderret
order_items_in = orderitem
ORDER_ITEMS_INX =
order_partners = orderpart
ORDER_SCHEDULES_IN =
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
order_text = ordertext
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
describe table orderret lines lv_lines.
READ TABLE orderret into wa_ret index lv_lines.
IF wa_ret-type = 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / wa_ret-message_v2.
ENDIF.
Hope it helps.
Regards,
Akshay Bhagwat
Note: Pls reward points if this helps you. -
Upload Task List Operation long Text using SAVE_TEXT-Urgent
Hi ,
I am trying to create Task List Operation Long text using the function module ..
SAVE_TEXT .I am passing the following keys
Text Name 300ATEST057 0000000900000009
Language EN
Text ID PLPO Long Text
Text Object ROUTING Texts for task list types
But the long texts are not getting updated in the Task lists operations .
Can anyone please suggest whether SAVE_TEXT will work for Operation long Texts or not Are we missing something
.This is pretty urgent requirement .Award points are assured.
Regards
Samhi,
use function module create text
check the sample code
DATA: BEGIN OF itab OCCURS 0,
asnum LIKE asmd-asnum, " Service No
text(5000) TYPE c, " Long Text
END OF itab.
*DATA: itab1 LIKE itab OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF itab1 OCCURS 0,
asnum LIKE asmd-asnum, " Service No
sequ type i, " Text Sequence
text(5000) TYPE c, " Long Text
END OF itab1.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras. " Language
Constants
Object ID for Long Text of Service Master
CONSTANTS:c_best TYPE thead-tdid VALUE 'LTXT',
c_material TYPE thead-tdobject VALUE 'ASMD'. " Object
for file splitting.
DATA: start TYPE i,
len TYPE i VALUE 92,
totlen TYPE i,
n TYPE i.
PARAMETERS p_file LIKE rlgrap-filename."input file
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
LOOP AT itab.
itab1-asnum = itab-asnum.
CLEAR: totlen,n, start.
totlen = STRLEN( itab-text ).
n = totlen / len.
n = n + 1.
DO n TIMES.
itab1-text = itab-text+start(len).
itab1-sequ = sy-index.
start = start + len.
APPEND itab1.
ENDDO.
ENDLOOP.
delete itab1 where text is initial.
SORT itab1 BY asnum sequ.
LOOP AT itab1.
dt_lines-tdformat = '*'.
dt_lines-tdline = itab1-text.
APPEND dt_lines.
Call the Function Module to Create Text
AT END OF asnum.
dl_lan = sy-langu.
WRITE : / itab-asnum.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = itab1-asnum
IMPORTING
output = itab1-asnum.
MOVE itab1-asnum TO dl_name.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Service No'(001),
itab1-asnum.
ELSE.
WRITE:/ 'Long Text Created Successfully for Service No'(002),
itab1-asnum.
ENDIF.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
in text file give first field records in capitals
regards
siva -
Creating text in VA01 and userexits
When I'm creating text in userexit USEREXIT_SAVE_DOCUMENT on header level it is working as I'm expected. Text is stored as my logic in userexit prepare it. When I put some text manually, before I'll save SO only this text is saved. This is strange, because I read first manually added text, I concatenate it together with this prepared by my logic and I'm updating it using SAVE_TEXT. Any idea why this happened. Could anyone explain my what stays behind text creation when saving SO?
In other words, I'm trying to add a personalized text at the end of text which use puts manually during SO creation and this is not working,
Kind Regards, Tomasz Suchanek
Edited by: Tomasz Suchanek on Jun 29, 2009 10:00 AMHi,
There could be two reasons
1. your text might be getting cleared when you reach the position where you are trying to concatenate
2. You might not be in right place in UE as variables might not be getting copied that point of time...
Solution: Try to keep watch point for that variable(texts) and see where it is getting cleared or filled. then take the necessary steps accordingly. -
PR to PO ...Standard text problem
Hi all,
I am writing one report , which converts the purchasing requistion to purchase order. I am using the BAPI function module...BAPI_PO_CREATE1.
In this i want to populate the purchase order header text. I am using the standard text for all po's whose are convertable.
but the problem is , the header text table paramers(POTEXTHEADER) in BAPI FM will take 132 chars only. But my standard text is 6 paragraphs are there . how do i long text populate? Am i using the wrong parameters in the BAPI FM.
please suggest me ...how to use this BAPI FM , to populate the lonf standard text.
regards,
Ajay Reddy
Edited by: Ajay on May 27, 2008 9:08 AMhi
use the function module create_text to upload long text. below is the
sample program which uploads purchase order text more than 132 characters.
TABLES : MARA, TLINE, THEAD.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR, " MATERIAL NUMBER
TEXT(5000) TYPE C, " Long Text
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
MATNR LIKE MARA-MATNR, " Material No
SEQU TYPE I, " Text Sequence
TEXT(5000) TYPE C, " Long Text
END OF ITAB1.
DATA:BEGIN OF DT_LINES OCCURS 0.
INCLUDE STRUCTURE TLINE. " Long Text
DATA:END OF DT_LINES.
DATA : P_FILE1 TYPE STRING.
DATA : DL_NAME TYPE THEAD-TDNAME, " Object Name(material no)
DL_LAN TYPE THEAD-TDSPRAS. " Language
CONSTANTS:C_BEST TYPE THEAD-TDID VALUE 'BEST',
C_MATERIAL TYPE THEAD-TDOBJECT VALUE 'MATERIAL'. " OBJECT
DATA: START TYPE I,
LEN TYPE I VALUE 92,
TOTLEN TYPE I,
N TYPE I.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-101.
PARAMETERS P_FILE LIKE RLGRAP-FILENAME."input file
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM FETCH_FILE USING P_FILE.
*& Form fetch_file
text
-->P_FILE text
FORM FETCH_FILE USING P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
ENDFORM. "fetch_file
START-OF-SELECTION.
PERFORM UPLOAD USING P_FILE. " *To Upload Flat file
PERFORM UPLOAD_TEXT.
*& Form UPLOAD
text
-->P_FILE text
FORM UPLOAD USING P_FILE.
P_FILE1 = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = P_FILE1
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC EQ 0.
*message i001 with p_file .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "UPLOAD
*& Form UPLOAD_TEXT
text
FORM UPLOAD_TEXT.
LOOP AT ITAB.
ITAB1-MATNR = ITAB-MATNR.
CLEAR: TOTLEN,N, START.
TOTLEN = STRLEN( ITAB-TEXT ).
N = TOTLEN / LEN.
N = N + 1.
DO N TIMES.
ITAB1-TEXT = ITAB-TEXT+START(LEN).
ITAB1-SEQU = SY-INDEX.
START = START + LEN.
APPEND ITAB1.
ENDDO.
ENDLOOP.
DELETE ITAB1 WHERE TEXT IS INITIAL.
SORT ITAB1 BY MATNR SEQU.
LOOP AT ITAB1.
DT_LINES-TDFORMAT = '*'.
DT_LINES-TDLINE = ITAB1-TEXT.
APPEND DT_LINES.
AT END OF MATNR.
DL_LAN = SY-LANGU.
WRITE : / itab-MATNR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ITAB1-MATNR
IMPORTING
OUTPUT = ITAB1-MATNR.
MOVE ITAB1-MATNR TO DL_NAME.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = C_BEST
FLANGUAGE = DL_LAN
FNAME = DL_NAME
FOBJECT = C_MATERIAL
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = DT_LINES
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
WRITE:/10 'Long Text Creation failed for Material No', ITAB1-MATNR.
ELSE.
WRITE:/10 'Long Text Created Successfully for Material No', ITAB1-MATNR.
ENDIF.
REFRESH DT_LINES.
ENDAT.
ENDLOOP.
ENDFORM. "UPLOAD_TEXT -
Hi All,
When Uploading the Data for FB02, i am facing problem with long-text.I have used FM SAVE_TEXT.But How to Save all the lines Data.Please send me the code for FB02,where all lines data has to be saved.
Thanks&Regards.Sri,
check this code for more than 5K char:
TABLES : MARA, TLINE, THEAD.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR, " MATERIAL NUMBER
TEXT(5000) TYPE C, " Long Text
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
MATNR LIKE MARA-MATNR, " Material No
SEQU TYPE I, " Text Sequence
TEXT(5000) TYPE C, " Long Text
END OF ITAB1.
DATA:BEGIN OF DT_LINES OCCURS 0.
INCLUDE STRUCTURE TLINE. " Long Text
DATA:END OF DT_LINES.
DATA : P_FILE1 TYPE STRING.
DATA : DL_NAME TYPE THEAD-TDNAME, " Object Name(material no)
DL_LAN TYPE THEAD-TDSPRAS. " Language
CONSTANTS:C_BEST TYPE THEAD-TDID VALUE 'BEST',
C_MATERIAL TYPE THEAD-TDOBJECT VALUE 'MATERIAL'. " OBJECT
DATA: START TYPE I,
LEN TYPE I VALUE 92,
TOTLEN TYPE I,
N TYPE I.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-101.
PARAMETERS P_FILE LIKE RLGRAP-FILENAME."input file
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM FETCH_FILE USING P_FILE.
*& Form fetch_file
text
-->P_FILE text
FORM FETCH_FILE USING P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
ENDFORM. "fetch_file
START-OF-SELECTION.
PERFORM UPLOAD USING P_FILE. " *To Upload Flat file
PERFORM UPLOAD_TEXT.
*& Form UPLOAD
text
-->P_FILE text
FORM UPLOAD USING P_FILE.
P_FILE1 = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = P_FILE1
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC EQ 0.
*message i001 with p_file .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "UPLOAD
*& Form UPLOAD_TEXT
text
FORM UPLOAD_TEXT.
LOOP AT ITAB.
ITAB1-MATNR = ITAB-MATNR.
CLEAR: TOTLEN,N, START.
TOTLEN = STRLEN( ITAB-TEXT ).
N = TOTLEN / LEN.
N = N + 1.
DO N TIMES.
ITAB1-TEXT = ITAB-TEXT+START(LEN).
ITAB1-SEQU = SY-INDEX.
START = START + LEN.
APPEND ITAB1.
ENDDO.
ENDLOOP.
DELETE ITAB1 WHERE TEXT IS INITIAL.
SORT ITAB1 BY MATNR SEQU.
LOOP AT ITAB1.
DT_LINES-TDFORMAT = '*'.
DT_LINES-TDLINE = ITAB1-TEXT.
APPEND DT_LINES.
AT END OF MATNR.
DL_LAN = SY-LANGU.
WRITE : / itab-MATNR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ITAB1-MATNR
IMPORTING
OUTPUT = ITAB1-MATNR.
MOVE ITAB1-MATNR TO DL_NAME.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = C_BEST
FLANGUAGE = DL_LAN
FNAME = DL_NAME
FOBJECT = C_MATERIAL
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = DT_LINES
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3.
IF SY-SUBRC 0.
WRITE:/10 'Long Text Creation failed for Material No', ITAB1-MATNR.
ELSE.
WRITE:/10 'Long Text Created Successfully for Material No', ITAB1-MATNR.
ENDIF.
REFRESH DT_LINES.
ENDAT.
ENDLOOP.
ENDFORM. "UPLOAD_TEXT
Maybe you are looking for
-
in FTR_edit, cash flow tab, I have one treasury deal with flow type Z110 (future purchase), my transaction type is "open", for this transaction type, I have two flow type Z110, Z111(charges) assigned, but when I use FTR_create, only Z110 is appeared
-
Hi<br> I am trying to use the account transformation Business Rule in BPC 7 for MS. I have stored data gainst the the following <br> application = legal<br> period = 2009.006<br> category = Actual<br> ConsolView = LC<br> Intco = I_9005<br> Measure =
-
"Database Audit Specification" not available.
Hi all, Been asked by one of the developers to audit delete & insert for one night only so I thought to investigate built in auditing via "new Database Audit Specification". I am in the sysadmin role but no option to add a database audit, the serv
-
My HP C4795 is not printing correctly. It will print some sentences from a text document and others it only prints half of the sentence. And when I say half, I mean it only prints the top half of the letters of an entire sentence. I've cleaned and re
-
Ho to view dbx files in Windows 7?
I have installed Windows 7. This package standard program, I did not find Outlook Express. I have many save the file dbx, how do I open or import to another format?