Clearing long text
Hi experts..
Iam working on dialog program.
After saving the data using save_text, i want to clear
my container.
Is there any function or class to clear the container??
Thanks
kaki
HI,
try this FM.
<b>INIT_TEXT</b>
Regards,
Similar Messages
-
Hi folks,
iam uploading longtext in transaction KP06 in bdc programing using create_text.
now my problem is if i pass selection criteria
case 1:
Vertion : N0
fiscal year : 2007
planner profile: CCPLAN4
then the budeget plan data uploading successfully along with long text.
case2: Vertion : N1
in this case also everthing wrking fine
case3: Vertion : 001
in this case budgetplan data uploading sucessfully but longtext is not uploading,
i debbug the proragm , create_text also returning sy-subrc = 0. but if i check in KP06 the long text is not there.
data declaration
vertion : VERSN type C(3)
can u tell me the problem is in logic or with FM ?
note : i checked with save_text also.
regards
neeruHI Naimesh,
the FM Create_text internally contains both FMs save_text and commit_text,
even i debug the FM in case of vertion N1, N0 and 001,
all the cases sy-subrc = 0.
code:
CLEAR G_OBJNR.
LOOP AT RECORD.
COST = RECORD-BDC01.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = COST
IMPORTING
output = COST.
CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.
SELECT SINGLE * FROM COSP WHERE OBJNR = g_objnr
AND GJAHR = P_GJAHR
AND VERSN = p_ver
AND KSTAR = COST.
IF SY-SUBRC = 0.
LEDNR = COSP-LEDNR.
OBJNR = COSP-OBJNR.
GJAHR = COSP-GJAHR.
WRTTP = COSP-WRTTP.
VERSN = COSP-VERSN.
KSTAR = COSP-KSTAR.
HRKFT = COSP-HRKFT.
VRGNG = COSP-VRGNG.
VBUND = COSP-VBUND.
PARGB = COSP-PARGB.
BEKNZ = COSP-BEKNZ.
TWAER = COSP-TWAER.
CONCATENATE LEDNR OBJNR INTO OBJNR.
CONCATENATE OBJNR GJAHR INTO TNAME1 separated BY SPACE10.
CONCATENATE TNAME1 WRTTP VERSN INTO TNAME2.
CONCATENATE TNAME2 KSTAR INTO TNAME3 separated BY SPACE.
CONCATENATE TNAME3 VRGNG INTO TNAME4 separated BY SPACE4.
CONCATENATE TNAME4 BEKNZ INTO TNAME5 separated BY SPACE10.
CONCATENATE TNAME5 TWAER INTO TNAME.
I_THEAD-TDOBJECT = 'CCSS'.
I_THEAD-TDID = 'COSP'.
I_THEAD-TDNAME = TNAME.
I_THEAD-TDSPRAS = 'E'.
APPEND I_THEAD.
i_tline-tdformat = '*'.
I_TLINE-TDLINE = RECORD-LONGTEXT.
APPEND I_TLINE.
loop at i_thead.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = I_THEAD-TDID
FLANGUAGE = I_THEAD-TDSPRAS
FNAME = I_THEAD-TDNAME
FOBJECT = I_THEAD-TDOBJECT
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = i_tline
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CLEAR I_TLINE.
REFRESH I_TLINE.
CLEAR I_THEAD.
REFRESH I_THEAD.
SELECT SINGLE * from cokp into itab WHERE OBJNR = g_objnr
AND GJAHR = P_GJAHR
AND VERSN = p_ver
AND KSTAR = COST.
if sy-subrc = 0.
itab-TXFLG = 'X'.
append itab.
write:/ 'Text saved for', record-bdc00 , record-bdc01.
else.
write:/ 'Text saved for', record-bdc00 , record-bdc01.
ENDIF.
ENDIF.
my program wrking fine but the long text is not visible for vertion 001.
regards
niru -
Urgent : ALV , how to display long text in colum field
Dear All,
Have mada an ALV report, but in some column have to show long text like.
"Qty of Processed Finished Goods receive with wt/length/pieces / units "
but while display of ALV it's showing only :
" Qty of Processed Finished Goods receive with wt/length/p "
Plz tell is it possible to show all the contents in that field, even in multiple row. like :
"Qty of Processed Finished
Goods receive with wt/length/pieces
/ units "
Looking forward to your earliest response.
Regards,
Gulrez AlamHi,
In your field catelog
w_fieldcat-tabname = 'Internal table name'.
w_fieldcat-fieldname = 'Field of the internal table'.
w_fieldcat-outputlen = '90'.----Here you have to increse the length
w_fieldcat-col_pos = '1'.
w_fieldcat-row_pos = '1'.
w_fieldcat-seltext_l = 'Qty of Processed Finished Goods receive
with wt/length/pieces / units '.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
Pls. reward if useful... -
Tcode FV50: How to find long text in FI Document line item Before Saving.
Hi,
How to find long text in FI Document line item.
During Parking of the FI document through Tcode FV50 i m giving the some text in the long text not in the text field.
I would like to validate the Long Text Before Saving in user exit "U300" under the "Sunstitution" .
Please anybody can be help me out where exactly this long text is going to be stored or in which internal table or memory id.
Please give me the answer as soon as possible .
Note:- Read_Text function module is not useful. Because Read_text useful after saving document.Hi Amit,
In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
Just try to explore in your system how the other validations are maintained.
After you are done with all your code, you have to run the regeneration program RGUGBR00.
Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS & TRACE PROG. GENERATE CALLS .
Hope this make your doubt clear.
Regards
Abhii -
Hi All,
In my BSp application user can enter long text ( can be more than 300 char ) in TextEdit.
problem is as below:
1) i am getting all the text in oninput processing ...
2) using the FM READ_TEXT to get mail template built in SO10.
3) Replacing all dynamic variables in mail template with user enterd text.
4) then passing the data to FM SO_NEW_DOCUMENT_SEND_API1. this FM has table parameter with 255 char ( please check once )
i am able to send the data in mail. But long text more than 256 char is not comming as single paragraph.
For expamle ...user enter the following text in text edit.
Responsible for the development, implementation, and maintenance of human resource information systems (HRIS) associated with the collection, retrieval, accessibility, and usage of employee information for Human Resource department planning and activities. Maintains internal database files and tables, and develops custom reports to meet the requirements of Human Resource management and staff.
in inbox i am getting as below:
Job Description for : Responsible for the development, implementation, and maintenance of human resource information systems (HRIS) associated with the collection, retrieval, accessibility, and usage of employee information for Human Resource depa
Maintains internal database files and tables, and develops custom reports to meet the requirements of Human Resource management and staff.
Job Description for is fixed text from SO10 templete. and remainning text is user text.
some data is missing in mail.
SO10 template is as below :
Job Description for : &INSTRUC1&
&INSTRUC2&
help to solve the above issue.
Regads,
Kishan
Edited by: kishanrao.sap on Oct 11, 2010 3:12 PMHi Krishna,
Please use the object_type parameter of tthe FM as 'HTM'.
Then divide the text by append them into the lines of the object_content. In the begining and end make sure you have
<p> -- in the begining
</p>-- in the end
if i want to type the text in one para " My name is Imran and i am an ABAP developer".
CLEAR: WA_OBJECT_CONTENT.
WA_OBJECT_CONTENT-line = '<html>'<body><p> My name is Imran.
APPEND WA_OBJECT_CONTENT TO T_OBJECT_CONTENT.
CLEAR WA_OBJECT_CONTENT.
WA_OBJECT_CONTENT-line = ' and i am an ABAP developer</p></body><html;>'.
APPEND WA_OBJECT_CONTENT TO T_OBJECT_CONTENT.
Hope this helps you.
Regards
Imran. -
How to keep long text in bdc using create_text function module
hi,
ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
i need some other information like how can i pass this to BDC i got like this .
can u plz check it.
its a length of 255 chaters
perform bdc_field using 'RSTXT-TXLINE(02)'
'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
& 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
perform bdc_field using 'RSTXT-TXLINE(03)'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
& 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
perform bdc_field using 'RSTXT-TXLINE(04)'
'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
& 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
perform bdc_field using 'RSTXT-TXLINE(05)'
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
& 'hhhhhhhhhhhhhhhhhhhhhh'.Hi,
Use this coding where do u want,
data: begin of textline occurs 10.
include structure tline.
data: end of textline.
start-of-selection.
textline-tdformat = '*'.
textline-tdline = 'TESTING FOR CREATION OF TEXT'.
append textline.
clear textline.
call function 'CREATE_TEXT'
exporting
fid = '0013'
flanguage = sy-langu
fname = '0095000501'
fobject = 'VBBK'
tables
flines = textline
exceptions
no_init = 01
no_save = 02.
end-of-selection. -
How to create long text in production order?
Hi,
i have found that i could only change long text in the
production order by 'SAVE_TEXT'.
but i want to create long text and any advice?DATA:TEXT_HEADER LIKE THEAD.
DATA:TEXT_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE.
data: t_ponum like BAPI_ORDER_KEY-ORDER_NUMBER.
t_ponum = '000040000068'.
TEXT_HEADER-TDID ='KOPF'.
TEXT_HEADER-TDOBJECT = 'AUFK'.
TEXT_HEADER-TDSPRAS = sy-LANGU .
CONCATENATE SY-MANDT t_ponum INTO TEXT_HEADER-TDNAME.
clear text_lines.
refresh text_lines.
text_lines-TDFORMAT = '*'.
text_lines-TDLINE = '12567'.
append text_lines.
text_lines-TDFORMAT = '*'.
text_lines-TDLINE = 'lg'.
append text_lines.
text_lines-TDFORMAT = '*'.
text_lines-TDLINE = 'prh'.
append text_lines.
text_lines-TDFORMAT = '*'.
text_lines-TDLINE = 'ueue'.
append text_lines.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
FID = TEXT_HEADER-TDID
FLANGUAGE = sy-LANGU
FNAME = TEXT_HEADER-TDNAME
FOBJECT = TEXT_HEADER-TDOBJECT
SAVE_DIRECT = 'X'
FFORMAT = '*'
TABLES
FLINES = text_lines
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = TEXT_HEADER
INSERT = ' '
SAVEMODE_DIRECT = 'X'
TABLES
LINES = text_lines.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = TEXT_HEADER-TDOBJECT
NAME = TEXT_HEADER-TDNAME
ID = TEXT_HEADER-TDID
LANGUAGE = sy-LANGU
SAVEMODE_DIRECT = 'X'. -
How to fill Long Text in Accounting document in the item level.
Hi,
I need to fill Long Text field in item level of accounting document from the header texts from Billing header(say billing instructions)
I checked the user exit EXIT_SAPLV60B_008 but it didnt worked in my case. I have read the billing instructions in the Billing header using FM READ_TEXT but I am not able to save this text using FM SAVE_TEXT because for the field Long Text the parameter TDNAME is a concatenation of BUKRS(COmpany code) BELNR(Accounting doc. no.) GHAJR(fiscal year) BUZEI(line item) .
But I am not able to capture this accounting doc. number in the mentioned user exit instead I am getting Sales Invoice number and hence not able to give TDNAME parameter for FM save_text.Hi Amit,
In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
Just try to explore in your system how the other validations are maintained.
After you are done with all your code, you have to run the regeneration program RGUGBR00.
Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS & TRACE PROG. GENERATE CALLS .
Hope this make your doubt clear.
Regards
Abhii -
Open iview url in WDA main view (below some long text)
Hi Experts,
My WDA first page is divided into 2 parts top & bottom.
The top will have some text and bottom will have a display areas to display the portal iview. (Display means open iview directly on opening the first page of the application without any action)
Eg: when you open the WDA in IE it will display some text in top & google webiste opened below that long text.
I tried putting the google url in iframe source in main view but it didnt displayed it. only a blank area came displayed which was of iframe size.
Hope i explained my requirement.
Regards,
NikHi Nikhil,
Your requirement is clear, but displaying google page where did you write the code.
Write your code in the View or component controller->WDINIT method, then first this method will display without any action.
In the Layout you can divide into two parts one is for text another one is for the google site display.
Let me know if you are not able to fix the issue still...send me the code I will let you know where is an issue.
Regards,
Naresh. -
How to display LONG TEXT STRING in Module Pool Screen ?
Hi Experts,
I want to display long text string, on screen designed through module pool(SE51). I tried to display through input/output field , but it displays it in SINGLE LINE and i have to scroll all through to view all string.
I want to display it in rectangular format . It doesnt allow me to set HEIGHT of component.
Please provide solution.
Thanks in advance.
Regards
DeepakThis is the program where u can get the WA_THEAD from other program like report and trying to display and modifying that text. U can do instead of WA_THEAD u can generate here itself and use also
*& Module pool ZMP_LTEXT *
PROGRAM ZMP_LTEXT .
TABLES: STXL.
*& Module STATUS_9000 OUTPUT
MODULE STATUS_9000 OUTPUT.
CONSTANTS:line_length type i value 132.
DATA:g_editor type ref to cl_gui_textedit,
g_editor_container type ref to cl_gui_custom_container,
CONT1 type scrfname value 'CONT1',
g_repid like sy-repid,
g_ok_code like sy-ucomm,
g_mytable(132) type c occurs 0,
g_mycontainer(30) type c ,
v_result(256) type c,
g_head like thead,
it_line type table of tline with header line,
wa_stxl type stxl.
DATA : BEGIN OF IT_THEAD1,
ICON TYPE ICON-ID.
INCLUDE STRUCTURE STXL.
DATA : END OF IT_THEAD1.
DATA : IT_THEAD LIKE TABLE OF IT_THEAD1,
WA_THEAD LIKE LINE OF IT_THEAD.
IMPORT WA_THEAD FROM MEMORY ID 'ABCD'.
select SINGLE * from STXL into wa_stxl
where tdname = '00006000156500000002'.
SELECT SINGLE * from STXL into wa_stxl
where tdname = WA_THEAD-TDNAME
AND TDID = WA_THEAD-TDID
AND TDOBJECT = WA_THEAD-TDOBJECT
AND TDSPRAS = WA_THEAD-TDSPRAS.
IF SY-SUBRC NE 0.
MESSAGE 'NO RECORD EXIST' TYPE 'E'.
ENDIF.
MOVE-CORRESPONDING WA_STXL TO G_HEAD.
SET PF-STATUS 'STATUS'.
SET TITLEBAR '001'.
if g_editor is initial.
CREATE OBJECT G_EDITOR_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = CONT1
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT G_EDITOR
EXPORTING
MAX_NUMBER_CHARS =
STYLE = 0
WORDWRAP_MODE = cl_gui_textedit=>wordwrap_at_fixed_position
for to fix number of characters in row to 132 characers
WORDWRAP_POSITION = line_length
WORDWRAP_TO_LINEBREAK_MODE = cl_gui_textedit=>true
for the word to break to next line if it dont fit in line
FILEDROP_MODE = DROPFILE_EVENT_OFF
PARENT = G_EDITOR_CONTAINER
LIFETIME =
NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5
others = 6 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH g_mytable.
MOVE: WA_THEAD-TDNAME TO STXL-TDNAME,
WA_THEAD-TDID TO STXL-TDID,
WA_THEAD-TDOBJECT TO STXL-TDOBJECT,
WA_THEAD-TDSPRAS TO STXL-TDSPRAS.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = wa_stxl-tdid
LANGUAGE = wa_stxl-tdspras
NAME = wa_stxl-tdname
OBJECT = wa_stxl-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_line
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_LINE INTO V_RESULT.
APPEND V_RESULT TO G_MYTABLE.
ENDLOOP.
CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = G_MYTABLE
EXCEPTIONS
ERROR_DP = 1
ERROR_DP_CREATE = 2
others = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
MODULE USER_COMMAND_9000 INPUT.
CASE SY-UCOMM.
REFRESH G_MYTABLE[].
REFRESH IT_LINE[].
CLEAR V_RESULT.
WHEN 'SAVE'.
CALL METHOD G_EDITOR->GET_TEXT_AS_R3TABLE
EXPORTING
ONLY_WHEN_MODIFIED = FALSE
IMPORTING
TABLE = G_MYTABLE
IS_MODIFIED =
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT G_MYTABLE INTO V_RESULT.
APPEND V_RESULT TO IT_LINE.
ENDLOOP.
CLEAR V_RESULT.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = G_HEAD
INSERT = ' '
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = IT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH G_MYTABLE[].
REFRESH IT_LINE[].
CLEAR V_RESULT.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
LEAVE TO SCREEN '0'.
*CALL SCREEN '0'.
WHEN OTHERS.
ENDCASE.
*G_OK_CODE = SY-UCOMM.
*CLEAR SY-UCOMM.
ENDMODULE. " USER_COMMAND_9000 INPUT -
Hi All,
I am facing a peculiar problem while executing an infoset query.I have created 2 customized fields Compa-ratio and PIR in infotype 0008 in an infoset.I have coded in these additional fields.
When I execute a query using 1 of these customized fields the report is generated correctly.But when I put both the fields in the output the report shows an error "Error when generating the report (see long text)". The message# associated with this errAQ_AD_HOC221.
I have also checked the data types and the references. Nothing seems to be wrong here.
Does anybody has any clue about this ?
KajalHi Bernd,
I had a look at those notes. But the information provided did'nt prove to be helpful. I found out the problem. I was using the same local variable for both the fields in their code. This generated the error. This error is a very generic one and does'nt help in finding out what exactly is the problem.
I changed the other local variable and it started working. When I was using the same variable that time I did'nt forget to clear the values but the query still generated the error.
Anyways thanks a lot for the reply.
Kajal -
Download to excel - long text in single row using gui_download
Hi Experts,
I want to download the long text (read_text) (500-600 characters) to excel in single row. the column width should be 60.
i am using the gui_download FM as in my report i m using one gui_download for header data and 2nd one for details using APPEND . Can u suggest me the solutions for the same. Can i use word wrap option and if yes , then how to use it?
For eg.
Customer Satisfaction
There are no escalations / adverse feedback from the customer
Customer uses him/her for benchmarking others
Regular status update to customer
Proactively understands future needs of customer
Increases customer's confidence so that there is an increase in quality / quantity of work
This whole text should appear as single row.
Thanks,
Edited by: Khushi p on Nov 12, 2010 10:44 AMI tried alot to put this in a legible format by usingcode...code but still it is not putting the code in a correct format.May be some mentor will put it in a good format so that you can understand.Below is a wraper progrm which meets your objective.
REPORT ZSCRATCHPAD.
TABLES:EKPO.
TYPE-POOLS:slis.
TYPES : BEGIN OF ty_ekpo,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp,
txz01 TYPE ekpo-txz01,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
loekz TYPE ekpo-loekz,
oic_ptrip TYPE ekpo-oic_ptrip,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
umrez TYPE ekpo-umrez,
umren TYPE ekpo-umren,
text TYPE string,
END OF ty_ekpo.
TYPES : BEGIN OF ty_text ,
tdformat TYPE tline-tdformat,
tdline TYPE tline-tdline,
END OF ty_text.
data: g_t_ekpo TYPE STANDARD TABLE OF ty_ekpo WITH HEADER LINE,
g_repid TYPE sy-repid,
g_ebeln(15),
l_fieldname1 LIKE ibipparms-path,
l_fieldname2 TYPE string,
g_objectid LIKE cdhdr-objectid,
g_t_text TYPE STANDARD TABLE OF ty_text WITH HEADER LINE,
g_t_text1 TYPE STANDARD TABLE OF ty_text WITH HEADER LINE.
data:g_fieldcat type slis_t_fieldcat_alv with header line,
g_events type slis_t_event,
wa_events like line of g_events,
g_listheader type slis_t_listheader,
walistheader like line of g_listheader,
g_layout type slis_layout_alv,
g_top type slis_formname,
g_sort type slis_t_sortinfo_alv with header line,
g_sort1 type slis_sortinfo_alv,
g_printparams type slis_print_alv,
g_variant type disvariant,
g_title type lvc_title,
g_excluding type slis_t_extab,
g_grid TYPE REF TO cl_gui_alv_grid.
field-symbols: <fs> type lvc_title.
SELECT-OPTIONS:P_EBELN FOR EKPO-EBELN NO INTERVALS.
PARAMETERS:p_r1 radiobutton group grp1,
p_r2 radiobutton group grp1.
SELECT ebeln
ebelp
txz01
matnr
werks
loekz
oic_ptrip
menge
meins
umrez
umren
INTO TABLE g_t_ekpo
FROM ekpo
WHERE ebeln IN p_ebeln
AND loekz NE 'L'.
IF sy-subrc <> 0.
CLEAR g_t_ekpo.
ENDIF.
define m_fieldcat.
g_fieldcat-fieldname = &1.
g_fieldcat-col_pos = &2.
g_fieldcat-seltext_l = &3.
g_fieldcat-do_sum = &4.
g_fieldcat-outputlen = &5.
g_fieldcat-checkbox = &6.
append g_fieldcat to g_fieldcat.
clear g_fieldcat.
end-of-definition.
if p_r1 = 'X'.
PERFORM summary_display.
else.
perform download.
endif.
FORM summary_display .
concatenate 'Test' ' ' into g_title separated by space.
assign g_title to <fs>.
g_repid = sy-repid.
m_fieldcat 'EBELN' '' 'EBELN' '' 10 ''.
m_fieldcat 'EBELP' '' 'EBELP' '' 05 ''.
m_fieldcat 'TXZ01' '' 'TXZ01' '' 40 ''.
m_fieldcat 'MATNR' '' 'MATNR' '' 10 ''.
m_fieldcat 'WERKS' '' 'WERKS' '' 04 ''.
m_fieldcat 'LOEKZ' '' 'LOEKZ' '' 01 ''.
m_fieldcat 'OIC_PTRIP' '' 'OIC_PTRIP' '' 16 ''.
m_fieldcat 'MENGE' '' 'MENGE' '' 13 ''.
m_fieldcat 'MEINS' '' 'MEINS' '' 03 ''.
m_fieldcat 'UMREZ' '' 'UMREZ' '' 05 ''.
m_fieldcat 'UMREN' '' 'UMREN' '' 05 ''.
g_layout-zebra = 'X'.
g_layout-colwidth_optimize = 'X'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
* i_callback_pf_status_set = 'SET_PF_STATUS'
is_layout = g_layout
i_callback_user_command = 'LIST1'
i_grid_title = <fs>
* i_callback_top_of_page = ' '
it_fieldcat = g_fieldcat[]
* it_excluding = g_excluding
i_save = 'A'
* is_variant = ITVARIANT
it_events = g_events[]
* is_print = ITPRINTPARAMS
* it_sort = itsort[]
tables
t_outtab = g_t_EKPO[]
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
clear:g_fieldcat.
refresh:g_fieldcat.
ENDFORM. " summary_display
form list1 using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
REFRESH g_t_text.
if rs_selfield-fieldname = 'EBELN'.
READ TABLE g_t_ekpo INDEX rs_selfield-tabindex.
CONCATENATE g_t_ekpo-ebeln g_t_ekpo-ebelp INTO g_ebeln. "CRQ94538-Capture text
SHIFT g_ebeln LEFT DELETING LEADING space.
PERFORM read_text USING g_ebeln g_t_text[].
IF g_t_text[] IS NOT INITIAL.
PERFORM pop_up_with_table .
ENDIF.
endif.
when 'OTHERS'.
leave to screen 0.
endcase.
endform. "list1
FORM read_text USING p_ebeln p_t_itab LIKE g_t_text1[].
PERFORM fill_readtext USING p_ebeln 'EKPO' 'F01' p_t_itab.
ENDFORM. " f0008_read_text
FORM fill_readtext USING p_vbeln
p_object
p_textid
pt_itab LIKE g_t_text[] .
DATA: ls_itab LIKE LINE OF g_t_text,
l_header LIKE thead,
l_tdname LIKE thead-tdname.
CLEAR pt_itab.
REFRESH pt_itab.
MOVE p_vbeln TO l_tdname.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = p_textid
language = sy-langu
name = l_tdname
object = p_object
IMPORTING
header = l_header
TABLES
lines = pt_itab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
endform. "fill_readtext
FORM pop_up_with_table .
CALL FUNCTION 'POPUP_WITH_TABLE'
EXPORTING
endpos_col = 82
endpos_row = 20
startpos_col = 10
startpos_row = 10
titletext = ' '
TABLES
valuetab = g_t_text
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc NE 0.
CLEAR g_t_text.
ENDIF.
ENDFORM. " f4000_pop_up_with_table
FORM download .
if g_t_ekpo[] is not initial.
loop at g_t_ekpo.
* concatenate text-001 g_t_ekpo-matnr into g_t_ekpo-matnr.
PERFORM convert_table_to_string.
modify g_t_ekpo.
clear g_t_ekpo.
endloop.
endif.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:/KKVT/TEST.XLS'
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = g_t_ekpo
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
message: 'file downloaded' type 'S'.
ENDIF.
ENDFORM. " download
FORM convert_table_to_string .
DATA: str TYPE string,
len TYPE i,
tot_len TYPE i.
FIELD-SYMBOLS <fs1> TYPE ANY.
IF g_t_ekpo-ebeln IS NOT INITIAL.
CONCATENATE g_t_ekpo-ebeln g_t_ekpo-ebelp INTO g_ebeln. "CRQ94538-Capture text
SHIFT g_ebeln LEFT DELETING LEADING space.
PERFORM read_text USING g_ebeln g_t_text[].
IF g_t_text[] IS NOT INITIAL.
CLEAR: len,
tot_len,
str.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE g_t_text TO <fs1>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
DESCRIBE FIELD <fs1> LENGTH len IN CHARACTER MODE.
ADD len TO tot_len.
ENDDO.
CALL FUNCTION 'CONVERT_TABLE_TO_STRING'
EXPORTING
i_tabline_length = tot_len
IMPORTING
e_string = str
TABLES
it_table = g_t_text[].
IF sy-subrc = 0.
g_t_ekpo-text = str.
ENDIF.
ELSE.
CLEAR: g_t_ekpo-text,
tot_len,
len,
str. .
ENDIF.
ENDIF.
ENDFORM. " convert_table_to_string
Edited by: Kiran K on Nov 18, 2010 5:21 AM -
Hi,
When i tried to create the delivery through BDC getting a message as "Order Can not be delivered (see long text)". Same message i am displaying in my ALV output also.Is there any FM to link to that long text documentation?
Please let me know,If any body have idea on this.
Regards,
Skumar.Hi
SAVE_TEXT writes a text module back to the text file or the text memory, depending on the storage mode of the corresponding text object.
You can use this module either to change existing texts or to create new texts. If you know for sure that the text is new, use the parameter INSERT to indicate this. The system then does not have to read the text first, which improves the performance of the function module.
If the lines table passed with the function module is empty, the system deletes the text from the text file.
http://help.sap.com/saphelp_40b/helpdata/en/d6/0db8ef494511d182b70000e829fbfe/content.htm
Assuming your falt file will have the asset number and text.
DATA: BEGIN OF ITAB1 OCCURS 0,
NUMBER(12),
TEXT(132),
END OF ITAB1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILE
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = ITAB1
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
ENDIF.
DATA: HEADER LIKE THEAD.
DATA: LINES TYPE STANDARD TABLE OF TLINE WITH HEADER LINE.
LOOP AT ITAB1.
AT NEW NUMBER.
HEADER-TDOBJECT = <OBJECT>.
HEADER-TDID = <ID>.
HEADER-NAME = <NAME>.
ENDAT.
move itab1-text to lines-tdline.
append lines.
AT END OF NUMBER.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = HEADER
* INSERT = ' '
SAVEMODE_DIRECT = 'X'
TABLES
LINES = LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
* text update succesful
ENDIF.
clear lines.
refresh lines.
ENDAT.
<b>Reward if usefull</b> -
G/L Account Long Text Field in Display
Dear Sir,
I want G/L Account long text field be displayed along with G/L account number in G/L Account line item display report (FBL3N)
I cheched the layout, the option of G/L account number is available but option of G/L account Long text is not available.
Kindly guide me as to how can I do it?
Regards
Chirag ShahYou must do some development for it.
You can add additional field to FBL*N reports with using BTE exit.
First of all, if you don't use BTE before, you must create a product on FIBF.
Call FIBF transaction -> Settings -> Products -> ...of a customer
Create a new line,
Product: ZFI
Text: BTE Products for FI Exit
Product active: tick checks from activation.
Then you must call SE11 for structure RFPOS.
You must use append structure function for this structure and you can define ZFI_RFPOS append structure
Define 4 fields.
Component: KUNNR - Component type: KUNNR
Component: NAMED - Component type: NAME1
Component: LIFNR - Component type: LINFR
Component: NAMEK - Component type: NAME1
Then save and active your RFPOS structure.
After that, you must do same step for structure RFPOSX.
Then go to SE37 and copy from SAMPLE_INTERFACE_00001650 to ZFI_INTERFACE_00001650 FM.
After copy action, you must uncomment this line on ZFI_INTERFACE_00001650 FM's source code. It's very important;
E_POSTAB = I_POSTAB.
Then you should add some ABAP code for getting customer & vendor details.
I give you some examples, you can use it. (Next message on this thread, please check)
Then save and active FM.
Call FIBF transaction again.
FIBF -> Settings -> Process Modules -> ...of a customer
Define a new line.
Process: 00001650
Function Module: ZFI_INTERFACE_00001650
Product: ZFI
and this customizing.
Then you go to SE38 transaction.
start report RFPOSXEXTEND. After starting, a pop-up appears, you must click YES.
After those operations, you can see customer/vendor code and their names on FBL3N.
ABAP source example,
TABLES : bseg, kna1, lfa1.
IF sy-tcode = 'FBL3N'.
CLEAR: bseg.
SELECT SINGLE *
FROM bseg
WHERE bukrs = i_postab-bukrs
AND belnr = i_postab-belnr
AND gjahr = i_postab-gjahr
AND koart = 'K'.
IF sy-subrc EQ 0.
e_postab-lifnr = bseg-lifnr.
CLEAR: lfa1.
SELECT SINGLE *
FROM lfa1
WHERE lifnr = bseg-lifnr.
IF sy-subrc EQ 0.
e_postab-namek = lfa1-name1.
ENDIF.
ENDIF.
CLEAR : bseg.
SELECT SINGLE *
FROM bseg
WHERE bukrs = i_postab-bukrs
AND belnr = i_postab-belnr
AND gjahr = i_postab-gjahr
AND koart = 'D'.
IF sy-subrc EQ 0.
e_postab-kunnr = bseg-kunnr.
CLEAR: kna1.
SELECT SINGLE *
FROM kna1
WHERE kunnr = bseg-kunnr.
IF sy-subrc EQ 0.
e_postab-named = kna1-name1.
ENDIF.
ENDIF.
ENDIF. -
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
Maybe you are looking for
-
How to handle error msgs in one system which are available only in another?
Hi Experts, I have two SAP systems A and B. An ABAP program in system A calls Function module in System B. System B returns any error with message id, class and variables in the event of any invalid data. How to handle this returned error
-
I purchased the iphone 4 16g version. After the operating system is installed on the phone, how much actual free space is left on the phone?
-
Indesign only prints one thumbnail
I'm trying to print thumbnails with the thumbnails print option in Indesign CS5, but I only get one thumbnail in the upper left corner on the print. The same thing happens when I export to PDF with the "Embed Page Thumbnails" option checked. Need som
-
Activity Based Budgeting in BPC 7.0NW
Hi friends, Currently I am on the blueprint phase of bpc7.0nw implementation. I was just wondering id someone can tell me that can we do activity based budgeting in BPC? and if yes than please tell me how. thanks
-
How Can I Improve This Picture?
Not sure if this link from Snapfish will work but here goes... http://www2.snapfish.com/slideshow/AlbumID=163291534/PictureID=3376495331/a=9827 786498277864/t=98277864 I've got this picture of the Lone Pine in Monterey that's a nice wide shot of the