Sie sind auf Seite 1von 25

Friday, December 31, 2010

Function Module related to Change Tracking


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CHANGEDOCUMENT_READ_HEADERS Read and format change documents read change document headers and items CHANGEDOCUMENT_READ to get the old and new values

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 1:25 PM 0 comments Links to this post Labels: SAP ABAP - Function Modules

Sunday, December 26, 2010


ABAP - Last sunday of previous month

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

DATA: date1 LIKE sy-datum, date2 LIKE sy-datum, day TYPE p. date1 = sy-datum. date1+6(2) = '01'. date1 = date1 - 1. day = date1 MOD 7. IF day = 0. day = 7. ENDIF. day = day - 1. date2 = date1 - day. WRITE: 'Last sunday of previous month is', date2.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 7:54 PM 0 comments Links to this post Labels: SAP ABAP - Date n Time function modules, SAP ABAP - Function Modules

ABAP - Function Module related to Change Tracking


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CHANGEDOCUMENT_READ_HEADERS Read and format change documents CHANGEDOCUMENT_READ MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

read change document headers and items to get the old and new values

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 5:47 PM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Data showing in popup - HELP_VALUES_GET_WITH_TABLE


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

Show a list of possible values for F4 popup help on selection screens. This function module pops up a screen that is just like all the other F4 helps, so it looks like the rest of the SAP system. Very useful for providing dropdowns on fields that do not have them predefined
REPORT ztest_notepad. TABLES: t001w. DATA: lc_werks LIKE t001w-werks, ltab_fields LIKE help_value OCCURS 0 WITH HEADER LINE, BEGIN OF ltab_values OCCURS 0, feld(40) TYPE c, END OF ltab_values. *-- Set up fields to retrieve data ltab_fields-tabname = 'T001W'. ltab_fields-fieldname = 'WERKS'. ltab_fields-selectflag = 'X'. APPEND ltab_fields. ltab_fields-tabname = 'T001W'. ltab_fields-fieldname = 'NAME1'. ltab_fields-selectflag = space. APPEND ltab_fields. *-- Fill values SELECT * FROM t001w. ltab_values-feld = t001w-werks. APPEND ltab_values. ltab_values-feld = t001w-name1. APPEND ltab_values. ENDSELECT. CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE' EXPORTING fieldname = 'WERKS' tabname = 'T001W' title_in_values_list = 'Select a value' IMPORTING select_value = lc_werks TABLES fields = ltab_fields valuetab = ltab_values

EXCEPTIONS field_not_in_ddic = 01 more_then_one_selectfield = 02 no_selectfield = 03.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:45 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Get the current fiscal year - GET_CURRENT_YEAR


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CALL FUNCTION EXPORTING BUKRS DATE IMPORTING CURRM CURRY PREVM PREVY

'GET_CURRENT_YEAR' = '1000' = SY-DATUM = = = = w_currm w_curry w_prevm w_prevy. " Company Code " Date to find fiscal year for " " " " Current Fiscal Month Current Fiscal Year Previous Fiscal Month Previous Fiscal Year

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:39 AM 0 comments Links to this post Labels: SAP ABAP - Date n Time function modules, SAP ABAP - Function Modules

Wednesday, December 22, 2010


ABAP - Amount and Currency Function modules
MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CURRENCY_AMOUNT_SAP_TO_IDOC - Convert currency to IDOC format

CONVERT_TO_LOCAL_CURRENCY - Conversion of currency

CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.

CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

Example 1: Convert amount to/from string


Amount to string:

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT' EXPORTING betrg = 3000 WAERS = 'DKK' * NEW_DECIMAL_SEPARATOR = * NEW_THOUSANDS_SEPARATOR = IMPORTING STRING = slam .
String to amount:

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT' EXPORTING string = slam2 DECIMAL_SEPARATOR = '.' * THOUSANDS_SEPARATOR = WAERS IMPORTING BETRG * EXCEPTIONS * CONVERT_ERROR * OTHERS = 'HUF' = b2 = 1 = 2

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 8:05 PM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Reports and Dynpros function modules


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

Selection-screen
RS_COVERPAGE_SELECTIONS Returns an internal table that contains a formatted list of all the selection parameters entered for a report. Table is ready to print out.

RS_REFRESH_FROM_SELECTOPTIONS Get the current contents of selection screen

RS_VARIANT_CONTENTS - Returns the contents of the specified variant in a table.

F4IF_SHLP_EXIT_EXAMPLE documents the different reasons to use a search help exit, and shows how it is done.

FILENAME_GET popup to get a filename from a user, returns blank filename if user selects cancel

F4IF_SHLP_EXIT_EXAMPLE documents the different reasons to use a search help exit, and shows how it is done.

F4_DATE - displays a calendar in a popup window and allows user to choose a date, or it can be displayed read only.

F4_IF_FIELD_VALUE_REQUEST Use values from a DDIC table to provide a list of possible values. TABNAME and FIELDNAME are required fields, and when

MULTIPLE_CHOICE is selected, more than one value can be returned.

HELP_START Display help for a field. Useful for doing AT SELECTION SCREEN ON VALUE REQUEST for those fields that do not provide F4 help at the DDIC level.

F4IF_INT_TABLE_VALUE_REQUEST F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.

HELP_VALUES_GET_WITH_TABLE Show a list of possible values help on selection screens. This function module pops up a is just like all the other F4 helps, so it looks like the SAP system. Very useful for providing dropdowns on fields have them predefined.

for F4 popup screen that rest of the that do not

Example: tables: t001w. DATA: lc_werks LIKE t001w-werks, ltab_fields LIKE help_value OCCURS 0 with header line, BEGIN OF ltab_values OCCURS 0, feld(40) TYPE c, END OF ltab_values. *-- Set up fields to retrieve data ltab_fields-tabname = 'T001W'. ltab_fields-fieldname = 'WERKS'. ltab_fields-selectflag = 'X'. APPEND ltab_fields. ltab_fields-tabname = 'T001W'. ltab_fields-fieldname = 'NAME1'. ltab_fields-selectflag = space. APPEND ltab_fields. *-- Fill values select * from t001w. ltab_values-feld = t001w-werks. append ltab_values. ltab_values-feld = t001w-name1.

append ltab_values. endselect. CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE' EXPORTING fieldname = 'WERKS' tabname title_in_values_list IMPORTING select_value TABLES fields valuetab EXCEPTIONS field_not_in_ddic more_then_one_selectfield no_selectfield = 'T001W' = 'Select a value' = lc_werks = ltab_fields = ltab_values = 01 = 02 = 03.

Exporting lists
LIST_TO_ASCII - convert an ABAP report (displayed on screen) from OTF to ASCII format

WRITE_LIST - Useful for writing out the list contents that result from the function LIST_FROM_MEMORY.

WWW_LIST_TO_HTML - After running a report, call this function to convert the list output to HTML.

LIST_TO_ASCII - convert an ABAP report (displayed on screen) from OTF to ASCII format

LIST_FROM_MEMORY - Retrieves the output of a report from memory when the report was executed using SUBMIT... EXPORTING LIST TO MEMORY. See also WRITE_LIST.

Dynpros
DYNP_VALUES_UPDATE - Similar to DYNP_VALUES_READ, this function will allow the updating of fields on a dynpro. Very useful when you want to change a field based on the value entered for another field.

DYNP_VALUES_READ - Read the values from a dynpro. This funciton can be used to read the values from a report's selection screen too.

SCROLLING_IN_TABLE - If you are coding a module pool and using a tablecontrol, you can use this function SCROLLING_IN_TABLE to handle any scrolling.

RPY_DYNPRO_READ Read dynpro, including screen flow

Other
RZL_SLEEP - Hang the current application from 1 to 5 seconds.

RZL_SUBMIT - Submit a remote report.

SAPGUI_PROGRESS_INDICATOR - Display a progress bar on the SAP GUI, and give the user some idea of what is happening

COMMIT_TEXT - To load long text into SAP

G_SET_GET_ALL_VALUES - Fetch values from a set.

HR_DISPLAY_BASIC_LIST - is an HR function, but can be used for any data. You pass it data, and column headers, and it provides a table control with the ability to manipulate the data, and send it to Word or Excel.

GET_GLOBAL_SYMBOLS Returns a list of all tables, select options, texts, etc for a program. Even includes the text definitions for the selection screen

GET_INCLUDETAB Returns a list of all INCLUDES in a program

GUI_RUN Start a File or Program Asynchronously with ShellExecute

RPY_TRANSACTION_READ Given a transaction, return the program and screen or given a program and screen, return the transactions that use the program and screen.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 6:48 PM 0 comments Links to this post Labels: SAP ABAP - Function Modules

Tuesday, December 21, 2010


ABAP - First and Last date of the month
MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

REPORT ZTEST_NOTEPAD. PARAMETERS :p_month(2) type n, p_year(4) type n. data:first_day LIKE VTBBEWE-DVALUT, last_day type datum, days(2) TYPE c.

"First date of the month CONCATENATE p_year p_month '01' INTO first_day. CALL FUNCTION 'END_OF_MONTH_DETERMINE_2' EXPORTING i_datum = first_day IMPORTING E_TT = days. "Last date of the month CONCATENATE p_year p_month days INTO last_day. WRITE:/ first_day, / last_day.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 9:30 PM 0 comments Links to this post Labels: SAP ABAP - Date n Time function modules, SAP ABAP - Function Modules

ABAP - Date and Time function modules


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CALCULATE_DATE DATE_TO_DAY

Calculates the future date based on the input . Returns the Day for the entered date.

DATE_COMPUTE_DAY DATE_GET_WEEK RP_CALC_DATE_IN_INTERVAL DAY_ATTRIBUTES_GET MONTHS_BETWEEN_TWO_DATES END_OF_MONTH_DETERMINE_2 HR_HK_DIFF_BT_2_DATES FIMA_DAYS_AND_MONTHS_AND_YEARS MONTH_NAMES_GET WEEK_GET_FIRST_DAY HRGPBS_HESA_DATE_FORMAT SD_CALC_DURATION_FROM_DATETIME L_MC_TIME_DIFFERENCE HR_99S_INTERVAL_BETWEEN_DATES LAST_DAY_OF_MONTHS DATE_CHECK_PLAUSIBILITY DATE_2D_TO_4D_CONVERSION DAY_IN_WEEK SD_DATETIME_DIFFERENCE MESSAGE

Returns weekday for a date Returns week for a date Add days / months to a date Returns attributes for a range of dates specified To get the number of months between the two dates. Determines the End of a Month. Find the difference between two dates in years, months and days. Find the difference between two dates in years, months and days. Get the names of the month Get the first day of the week Format the date in dd/mm/yyyy format Find the difference between two date/time and report the difference in hours Find the time difference between two date/time Difference between two dates in days, weeks, months Returns the last day of the month Check for the invalid date. Year entry: 2-character to 4-character. Input date and will give the name of the day 1-monday,2Tuesday.... Give the difference in Days and Time for 2 dates

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:41 AM 0 comments Links to this post Labels: SAP ABAP - Date n Time function modules, SAP ABAP - Function Modules

ABAP - F4 Help function modules


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

F4IF_INT_TABLE_VALUE_REQUEST F4IF_FIELD_VALUE_REQUEST HELP_OJECT_SHOW MESSAGE

F4 help also returning the value to be displayed in internal table. F4 help for fields that are only known at run time F1 Help

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:35 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Popup prompt function modules


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com

Regards,

Blog Moderator

POPUP_TO_CONFIRM POPUP_TO_GET_VALUE SAPGUI_PROGRESS_INDICATOR FILENAME_GET F4_DATE POPUP_TO_SELECT_MONTH GET_PRINT_PARAMETERS F4IF_INT_TABLE_VALUE_REQUEST F4IF_FIELD_VALUE_REQUEST MESSAGE

Displays a popup dialog with a user defined message for confirmation Displays a popup dialog requesting a value for a particular table-fieldname Displays a progress bar with text to denote the percentage of completion and status Displays a popup dialog to get the presentation server filename Displays a popup dialog to choose date Display a pop-up to select a month Printer parameters F4 help also returning the value to be displayed in internal table F4 help for fields that are only known at runtime

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:32 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Formating Function modules


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CLOI_PUT_SIGN_IN_FRONT RKD_WORD_WRAP CONVERSION_EXIT_ALPHA_INPUT

Displays the negative sign in front of the numeral Wrap text into several lines Pad zeros to the number at the left

CONVERSION_EXIT_ALPHA_OUTPUT Eliminate zeros to the number at the left Exchange Convertion READ_EXCHANGE_RATE SPELL_AMOUNT MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Transforms numeric values into text

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:26 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Function module related to Change documents


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com

Regards,

Blog Moderator

CHANGEDOCUMENT_READ_HEADERS Read and format change documents CHANGEDOCUMENT_READ MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

read change document headers and items to get the old and new values

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:23 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

Monday, December 20, 2010


ABAP - Amount and Currency function modules
MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

CURRENCY_AMOUNT_SAP_TO_IDOC

Convert currency to IDOC format Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are. Convert local currency to foreign currency. Convert from foreign currency to local currency Convert an amount from a currency to another (exchange rate taken from database tables) Convert an amount from a currency to another, according to the passed exchange rate Conversion of Currency Amounts into External Data Format Conversion of Currency Amounts into Internal Data Format to get Amount in words Changes INR amount to words.

CLOI_PUT_SIGN_IN_FRONT

CONVERT_TO_FOREIGN_CURRENCY CONVERT_TO_LOCAL_CURRENCY CONVERT_AMOUNT_TO_CURRENCY

CONVERT_CURRENCY_BY_RATE BAPI_CURRENCY_CONV_TO_EXTERNAL BAPI_CURRENCY_CONV_TO_INTERNAL CALCULATE_TAX_FROM_NET_AMOUNT SPELL_AMOUNT HR_IN_CHG_INR_WRDS MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 6:59 PM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Adding days to date


MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

REPORT

ztest_notepad.

PARAMETERS :p_months TYPE t5a4a-dlymo DEFAULT 18. DATA: days TYPE t5a4a-dlydy, years TYPE t5a4a-dlyyr, calc_date TYPE p0001-begda. CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL' EXPORTING date = sy-datum days = days months = p_months years = years IMPORTING calc_date = calc_date. WRITE calc_date.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 9:34 AM 0 comments Links to this post Labels: SAP ABAP - Date n Time function modules, SAP ABAP - Function Modules

Sunday, December 19, 2010


ABAP - Function module to Convert Numbers to words
MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

Use the Function Module SPELL_AMOUNT to convert the integer into text.
DATA v_int TYPE i VALUE '1000'. CALL FUNCTION 'SPELL_AMOUNT' EXPORTING amount = v_int language = sy-langu IMPORTING in_words = words. WRITE words-word. DATA words LIKE spell.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0 Posted by An SAP Consultant at 11:53 AM 0 comments Links to this post Labels: SAP ABAP - Function Modules

ABAP - Read long text using READ_TEXT function module

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards,

Blog Moderator

The long texts of a document are stored in a encrypted format in the STXH and STXL tables, where STXH stores the header information of the long text like TDOBJECT, which indicates which text object the long text belongs to, TDID which indicates the Text ID and TDNAME which is the actual name of the long text. As these texts are stored in a encrypted format, the text cannot be read using a SELECT statement. You will have to use the function READ_TEXT. The easiest way of getting to know the parameter values is to go to a document, open the long text in a full screen mode. For example, when you wan to see the long text for a Purchase order, go to transaction ME23n. Assume, you want to see the parameters for the Header Text. In the first Tab Strip Control, click on the Texts tab and select the Header Text node on the left hand side, which will display the text on the right hand side. Now, double click on the text editor on the right hand side. This will open the text in the full screen mode. In the menu Go To --> Header, you should be able to see the values for all the three parameters we discussed above. We will have to do the same thing for whichever text parameters we want to see.
CALL FUNCTION 'READ_TEXT' EXPORTING * CLIENT id language name object * ARCHIVE_HANDLE * LOCAL_CAT * IMPORTING * HEADER tables lines

= SY-MANDT = = = = = 0 = ' ' = =

* 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.

MESSAGE

Hello Friends, WELCOME to An SAP Consultant blog. I request you to send the problems and solutions, which are sharable to fellow consultants. If you want to share information, please send mail to the.sap.consultants@gmail.com Regards, Blog Moderator

Share on facebook Share on twitter Share on email Share on print More Sharing Services 0

Das könnte Ihnen auch gefallen