cancel
Showing results for 
Search instead for 
Did you mean: 

Making text in CAPS in a script

Former Member
0 Kudos

Hi Gurus,

I have a requirement in which I have to print a check.

I am done with that.

Now they want the employee address to come in CAPS.

Can anyone help me regarding this?

Its very urgent.

Cheers,

naveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

paste the code that u have written here. il check it.something is going wrong.

Former Member
0 Kudos

Hi Nayan,

This is the code written in perform.

FORM convert_caps TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

DATA: l_variable(35).

READ TABLE in_tab WITH KEY 'REGUH_ZANRE'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZNME1'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZNME2'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZNME3'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZNME4'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZSTRA'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZPFAC'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZPST2'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZPFOR'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZPSTL'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZREGI'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZORT1'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZORT2'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZLAND'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'T001-LAND1'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY 'REGUH_ZADNR'.

IF sy-subrc EQ 0.

l_variable = in_tab-value.

ENDIF.

CALL FUNCTION '2054_TRANSLATE_2_UPPERCASE'

EXPORTING

i_string = l_variable

IMPORTING

e_string = l_variable

EXCEPTIONS

error_occured = 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.

READ TABLE out_tab WITH KEY 'ADRS1_ZANRE'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZNME1'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZNME2'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZNME3'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZNME4'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZSTRA'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZPFAC'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZPST2'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZPFOR'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZPSTL'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZREGI'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZORT1'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZORT2'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZLAND'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1-LAND1'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

READ TABLE out_tab WITH KEY 'ADRS1_ZADNR'.

IF sy-subrc EQ 0.

out_tab-value = l_variable .

MODIFY out_tab INDEX sy-tabix.

ENDIF.

ENDFORM. "convert_caps

Let me know if you need anything else?

Naveen

Former Member
0 Kudos

Hi,

The matter of concern is that u are using just one variable to capture all your values. Is the script gonna export only one value to your subroutine. Is yes then its fine.

1. Ur script code should be like theis :

/: PERFORM convert_caps IN PROGRAM <the prog name u have given>

/: using &REGUH_ZANRE&

/: using &REGUH_ZNME1&

( continue this for all the variables )

/: changing &ADRS1_ZANRE&

(continue for all the others also)

/:endperform. (this is important.check this)

check this and let me know. If its still not coming il tell u how to debug it.

Thanks

Nayan

Former Member
0 Kudos

Hi Nayan,

Thanks for the help.

I missed the endperform.

Now my problem got solved.

I have awarded the points.

Naveen.

Former Member
0 Kudos

Hey...no problem dude...anytime...and thanks for the points.

Tc

Former Member
0 Kudos

Hi Nayan,

Can I know ur personal mail id, so that I can mail you in future.

Cheers,

Naveen

Former Member
0 Kudos

its in my business card. you can view it from there.If you dnt get it there, let me know..il give it to you.

Answers (2)

Answers (2)

former_member181995
Active Contributor
0 Kudos

Naveen,

you can either di it with perform routine and use fm 'STRING_UPPER_LOWER_CASE.

Amit.

Former Member
0 Kudos

Hi,

Write a subroutine for this, and send your address there. Convert it to upper case and print it.Its that simple.

Thanks

Nayan

Former Member
0 Kudos

Hi Nayak,

Thanks for reply.

I already tried doing that. But it some how not working. How can i debug that perform or is there any other sol that i can do in script directly.

Naveen.