‎2008 Apr 30 12:47 PM
hello
in a SAPSCRIPT form, is there a way to print something in UPPER CASE.
in our system, our vendor name is in mixed case and they are requesting that we print the vendor name in upper case so that we can use a positive pay feature that matches on the vendor names and they have to be in upper case. we were thinking of updating the tables to put all of the vendor names in upper case but I was wondering if there is a way to print in upper case. I haved checked thru the forums and I could not find anything
thanks in advance for the help
‎2008 Apr 30 1:10 PM
in SAP-SCRIPT itself it is NOT possible.
but you may do an external Perform like:
/: define &flv_vendor_name_uppercase&
/: perform transform_vendorname in program your_program
/: using &vendor_name&
/: changing &flv_vendor_name_uppercase&
/: endperform
A1 &flv_vendor_name_uppercase&
in the program your_program, which is just a dummyname you may use one of your programs here, you need to add the routine transform_vendorname like following:
form transform_vendorname TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA: lv_vendor_name type char40.
read table in_tab
with key name = ''.
if sy-subrc = 0.
lv_vendor_name = in_tab-value.
endif.
CALL FUNCTION '2054_TRANSLATE_2_UPPERCASE'
EXPORTING
i_string = lv_vendor_name
IMPORTING
E_STRING = lv_vendor_name
EXCEPTIONS
ERROR_OCCURED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
ENDIF.
read table out_tab
with key name = 'flv_vendor_name_uppercase'.
if sy-subrc = 0
out_tab-value = lv_vendor_name.
modify out_tab index sy-tabix.
endif.
endform.
Edited by: Florian Kemmer on Apr 30, 2008 2:12 PM
‎2008 Apr 30 1:05 PM
Use the function module: SWA_STRING_TO_UPPERCASE.
and pass the string which u want to convert to uppercase.
Reward if helpful.
Thanks.
‎2008 Apr 30 1:06 PM
hi Tim,
You can only solve this in the print program (not in the Script). Let's say you read the name of the vendor into field it_lfa1-name1. Than you have to do the following in the program:
TRANSLATE it_lfa1-name1 TO UPPER-CASE.
Changing the vendor name to upper case in the vendor master is probably not the right solution, because than you have the name upper case all the time (all reports, printouts, etc.), which probably you don't want.
hope this helps
ec
‎2008 Apr 30 1:10 PM
in SAP-SCRIPT itself it is NOT possible.
but you may do an external Perform like:
/: define &flv_vendor_name_uppercase&
/: perform transform_vendorname in program your_program
/: using &vendor_name&
/: changing &flv_vendor_name_uppercase&
/: endperform
A1 &flv_vendor_name_uppercase&
in the program your_program, which is just a dummyname you may use one of your programs here, you need to add the routine transform_vendorname like following:
form transform_vendorname TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA: lv_vendor_name type char40.
read table in_tab
with key name = ''.
if sy-subrc = 0.
lv_vendor_name = in_tab-value.
endif.
CALL FUNCTION '2054_TRANSLATE_2_UPPERCASE'
EXPORTING
i_string = lv_vendor_name
IMPORTING
E_STRING = lv_vendor_name
EXCEPTIONS
ERROR_OCCURED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
ENDIF.
read table out_tab
with key name = 'flv_vendor_name_uppercase'.
if sy-subrc = 0
out_tab-value = lv_vendor_name.
modify out_tab index sy-tabix.
endif.
endform.
Edited by: Florian Kemmer on Apr 30, 2008 2:12 PM
‎2008 Jun 03 2:49 PM
Florian
I have changed my Z program for the code that you sent
I also changed the CHECKADD window to put the code for calling the routine. the name is still appearing in mixed case.
is the CHECKADD window the correct place to put the code to change the print the name in uppercase on the check?
thanks in advance for the help
‎2008 Jun 05 3:21 PM
I am trying to get the address name on the check to print in upper case. I have modified the CHECKADD window and added the code tomy program based on the above suggesstion by Florian, but it is still not working. can someone take a look at the attached code and let me know if there is something that I have coded incorrectly that would not be changing the name to upper case
thanks..
AS
/
/: ADDRESS PARAGRAPH AS
/* start 06/02/08 THIXSON
/: DEFINE &ZNME1_UC& = ''
/: DEFINE &ZNME2_UC& = ''
/: DEFINE &ZNME3_UC& = ''
/: DEFINE &ZNME4_UC& = ''
/: PERFORM TRANSFORM_VENDORNAME IN PROGRAM ZFR_US_CHEQUE
/: USING ®UH-ZNME1&
/: CHANGING &ZNME1_UC&
/: ENDPERFORM
/: PERFORM TRANSFORM_VENDORNAME IN PROGRAM ZFR_US_CHEQUE
/: USING ®UH-ZNME2&
/: CHANGING &ZNME2_UC&
/: ENDPERFORM
/: PERFORM TRANSFORM_VENDORNAME IN PROGRAM ZFR_US_CHEQUE
/: USING ®UH-ZNME3&
/: CHANGING &ZNME3_UC&
/: ENDPERFORM
/: PERFORM TRANSFORM_VENDORNAME IN PROGRAM ZFR_US_CHEQUE
/: USING ®UH-ZNME4&
/: CHANGING &ZNME4_UC&
/: ENDPERFORM
/* end 06/02/08 THIXSON
/: TITLE ®UH-ZANRE&
/* start 06/02/08 THIXSON
/: NAME &ZNME1_UC&, &ZNME2_UC&, &ZNME3_UC&, &ZNME4_UC&
/* NAME ®UH-ZNME1&, ®UH-ZNME2&, ®UH-ZNME3&, ®UH-ZNME4&
/* end 06/02/08 THIXSON
/* NAME ®UD-ZNM1S&, ®UD-ZNM2S&
/: STREET ®UH-ZSTRA&
/: POBOX ®UH-ZPFAC& CODE ®UH-ZPST2& CITY ®UH-ZPFOR&
/: POSTCODE ®UH-ZPSTL&
/: REGION ®UH-ZREGI&
/: CITY ®UH-ZORT1&, ®UH-ZORT2&
/: COUNTRY ®UH-ZLAND&
/: FROMCOUNTRY &T001-LAND1&
/: ADDRESSNUMBER ®UH-ZADNR&
/: ENDADDRESS
‎2008 Jun 06 8:21 PM
I am still having problems with this. earlier I have attached the code that I am using. I am not sure how the new fields would get printed. I am not sure if I have to add some code to the CHECK window to print the new field names.
I am also trying to put a break in the section that I added to the program where it does the function to change the case but everytime that I run the process, It does not stop in the code. I think the the program is running as a different user so it is not stopping.
is there a awy to put a break to stop the program for any user that is calling the progtram?
‎2008 Jun 10 3:55 PM
I am trying to change the Uppercase option in the Paragraph formats for the T6 Check recipients tabulator etc. I checked the uppercase box and do the save. is states that is saved successfully but when I go back into the form, this option is still unchecked. I am not sure what is going on with this either
‎2008 Jul 02 2:28 PM
hello
I have the problem of printing the name in upper case solved. I had to comment out the line where it passes the address number to the print program.
*/: ADDRESSNUMBER ®UH-ZADNR*/: ENDADDRESS
I then had to print the new address in the CHECKADD window
/ &ZNME1_UC&
/ &ZNME2_UC&
/ &ZNME3_UC&
/ &ZNME4_UC&
/ ®UH-ZSTRA&
/ ®UH-ZPFAC& ®UH-ZPST2& ®UH-ZPFOR&
/ ®UH-ZPSTL&
/ ®UH-ZREGI&
/ ®UH-ZORT1&, ®UH-ZORT2&
/ ®UH-ZLAND&
/ &T001-LAND1&
the address is printing the blank lines for ZNME2,ZNME3, ZNME4 as well as the other fields when there is no data in the fields. I have to modify my program that is doing the translation to drop the blank lines and pass back the fields that only have data
thanks for the help on this