FAQ | Here you will find some common questions about ABAP/4 and developments. Many of the questions and answers are cut from the SAP R/3 LIST. |
Question: | How do I use variables in the FORMAT command. |
Answer: | DATA COLORID TYPE I VALUE 4. FORMAT INTENSIFIED ON COLOR = COLORID. |
Question: | When using CALL 'SYSTEM' id 'COMMAND' field unix-command How does one capture the results of the command? For example, it the unix-command were the date? thanks, |
Answer: | You capture the results in the table e.g TABL, like this DATA: BEGIN OF TABL OCCURS 0, LINE(560), END OF TABL. REFRESH TABL. CALL 'SYSTEM' ID 'COMMAND' FIELD PARCOM_LOC ID 'TAB' FIELD TABL-*SYS*. |
Question: | I am working on a program that needs to show number of days between 2 dates. When I scanned the function library, I only found a function to give you the number of years between dates. I can probably code this in ABAP but does anyone know if a function exists to do this. |
Answer: | I wrote this example for you. I think this is what you need. DATA: DATE_1 LIKE SY-DATUM ,DATE_2 LIKE SY-DATUM. DATA DAYS TYPE I. DATE_1 = SY-DATUM. DATE_2 = SY-DATUM + 65. DAYS = DATE_2 - DATE_1. WRITE:/ 'DATE_2=',DATE_2,'DATE_1=',DATE_1,'DAYS=',DAYS. Run this code and then you will understand. |
Question: | How do I concatenate two strings in Abap/4? |
Answer: | For all SAP Versions STR_LENGTH = STRLEN( STRING1 ). |
Question: | Has anyone been successful in suppressing the selection screen that is automatically displayed when
using logical data bases. I want to run a job in the background using a logical database and I do not
want the user prompted for the parameters. I want to pass the parameters in the program. |
Answer: | Try using the SUBMIT rep USING SELECTION-SET 'variant' WITH .... command in the report to pass the variant thru the program |
Question: | I would like to know how to execute from ABAP code an external Unix program and check for a return code ? |
Answer: | There are different ways to this: (1) OPEN DATASET <file> FOR OUTPUT 'unix command' CLOSE DATASET <file> This command executes the unix command and writes the output into <file> Look into OSS Note 9391.
|