ABAP Frequently asked questions Part Two

B D C

Q: Our ABAP program is working properly in Foreground. Can I schedule it for background processing on the weekend?

A: SAP standard program RSBDCSUB helps you to schedule the job. Create a variant for RSBDCSUB with the BDC session name.

Q: How can we send a mail to the user intimating him that his report/BDC is completed in background?

A: You can use FUNCTION RS_SEND_MAIL_FOR_SPOOLLIST

If Unix is being used, you may send a report to any internet mail with the following:

REPORT ZSNDMAIL .
DATA: COMND(200) type c.
DATA: RESULT(200) type c occurs 100 with header line.
PARAMETERS: FILE(60) type c lower case default '/sapdata/sd_outbound/testmail.dat'.
PARAMETERS: SUBJECT(60) type c lower case.
PARAMETERS: EMAIL(60) type c lower case.
INITIALIZATION.
TRANSLATE EMAIL TO LOWER CASE.
START-OF-SELECTION.
TRANSLATE EMAIL TO LOWER CASE.
CONCATENATE 'cat' FILE '| elm -s "' subject '"' email into comnd seperated by space.
CALL 'SYSTEM' ID 'COMMAND' FIELD comnd 'TAB' FIELD UNIX_RESULTS-*SYS*.
Loop at Results.
write: /1 results.
endloop
end-of-selection.

SAP Script

Q: We get the total number of pages as expected by using 'SAPSCRIPT-FORMPAGES' in a duplex layout. In our case duplex case is always 'Terms & Conditions'. We do not want the number of pages as in duplex printing. What is the best possible solution?

A: On the Terms & Conditions page, Change the Page counter mode to 'HOLD' to keep the page counter from incrementing when you print the Term & Conditions.

Q: Can I Print a logo on an Invoice?

A: Save a Logo using Paintshop Pro or Corel Draw as Tiff file. Use RSTXLDMC to convert the logo to standard text in SapScript. When the program is executed, the path and file name have to be correctly specified.

Process could be like the following:
Run RSTXLDMC
Enter file name C:\MAIL\COMPLOGO.TIF
Resolution for Tiff file
Absolute X-position
Absolute Y-position
Absolute positioning
Reserved height
Shift to right
UOM = CM
Text title
Line width for text = 132
Text name ZHEX-MACRO-COMPLOGO
Text ID ST
Text language = E
Postscript scaling
Width & Height according to PS scaling
Number of Tiff gray levels (2,4,9) 2
Then Create a new window 'COMP' with attributes;
Window COMP description Company Logo
Window type CONST
Left margin 7.00 CH window width 10.00 CH
Upper margin LN window height 8.00 LN
Finally in the text element , mention
/: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.
Please note that if object name is not indicated as 'ZHEX...', the logo may not be printed!

You will not be able to see the logo in a test print. The same will be printed in actual printout.

If you are using two logos in the same layout, the names of the logos should be unique. Say 'ZHEX-MACRO-LOGO1' and 'ZHEX-MACRO-LOGO2'. Else all the information will be overwritten.

If the logo is not EXACTLY TIFF 6.0 , the same will not be printed.

RELATED POSTS


ABAP FAQ'S PART 3
SAP mini applications programming and setup
SAP Project design look and feel
My SAP Project safety and security

No comments :

Post a Comment