cancel
Showing results for 
Search instead for 
Did you mean: 

Defining Language specific Printer in driver Program

Former Member
0 Kudos

I am Working On Customer Account Statement.

This statement should get printed in 10 different languages.

For 8 languages I have to use LOCL printer and for rest 2 languages I have to use ZLOCL printer.

I have to define this printers in my driver program.

I am trying to change the variant which is created for my driver program.

I am using FM RS_VARIANT_CONTENTS to get variant contents and then changing the printer name to LOCL and then using FM RS_CHANGE_CREATED_VARIANT to update the variant.

It is updating printer but updating as $LOCL. I donu2019t want $ sign. How can I resolve this problem????

But ZLOCL is getting updated correctly. Problem is only with LOCL.

Regards,

Anuja Dhondge

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member223537
Active Contributor
0 Kudos

Hi,

Lets assume that the $LOCL value is in variable l_print.

Modify the logic to incorporate the following code :

replace all occurrences of '$' in l_print with ' '.
condense l_print no-gaps.

Best regards,

Prashant

Former Member
0 Kudos

hi,

u can put a check on language condition and den if locl is coming with an extra $ prefix wd it ..

suppose variable is ch = $locl

then ch = ch+1(4)

Former Member
0 Kudos

This document is not helpful for me...

can u plz provide me some another solution??

Regards,

Anuja dhondge

Former Member
0 Kudos

Hi use the above suggested solution of modifying the string

Former Member
0 Kudos

Have look in sample program.....

It does not contains languages in it....

TYPES : BEGIN OF T_VALUET,

V_SELNAME TYPE /OSP/DT_ERP_PARAM_NAME,

V_LOW TYPE /OSP/DT_VALUE,

END OF T_VALUET.

DATA : ET_RET TYPE BAPIRET2_T,

ET_VALUET TYPE /OSP/TT_REP_VAR_NAMEVALUEPAIRS,

IT_VAL TYPE STANDARD TABLE OF RSPARAMS .

DATA : V_LOW TYPE /OSP/DT_VALUE.

DATA : WA_VAL TYPE RSPARAMS .

DATA : WA_ET_VALUET TYPE /OSP/TT_REP_VAR_NAMEVALUEPAIRS.

DATA : PRINTER TYPE STRING,

ls_variant_desc TYPE varid.

data variant_text type table of varit.

data : printernm type String.

printernm = 'LOCL'.

CALL FUNCTION 'RS_VARIANT_CONTENTS'

EXPORTING

report = 'ZF_REPT_RFKORD11'

variant = 'ZSP13'

  • MOVE_OR_WRITE = 'W'

  • NO_IMPORT = ' '

  • EXECUTE_DIRECT = ' '

  • IMPORTING

  • SP =

tables

  • L_PARAMS =

  • L_PARAMS_NONV =

  • L_SELOP =

  • L_SELOP_NONV =

valutab = IT_VAL.

  • OBJECTS =

  • FREE_SELECTIONS_DESC =

  • FREE_SELECTIONS_VALUE =

  • EXCEPTIONS

  • VARIANT_NON_EXISTENT = 1

  • VARIANT_OBSOLETE = 2

  • OTHERS = 3

.

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 IT_VAL INTO WA_VAL WITH KEY SELNAME = 'TDDEST'.

WA_VAL-LOW = printernm.

MODIFY IT_VAL FROM WA_VAL

TRANSPORTING LOW

WHERE SELNAME = 'TDDEST'.

CLEAR WA_VAL.

READ TABLE IT_VAL INTO WA_VAL WITH KEY SELNAME = 'PRDEST'.

WA_VAL-LOW = printernm.

MODIFY IT_VAL FROM WA_VAL

TRANSPORTING LOW

WHERE SELNAME = 'PRDEST'.

WRITE : /'SUCCESS'.

CALL FUNCTION '/OSP/CREATE_UPDATE_VARIANT'

EXPORTING

iv_report_name = 'ZF_REPT_RFKORD11'

IV_VARIANT = 'ZSP13'

iv_user_name = 'V-ANUJAD'

it_valuetab = IT_VAL

  • IV_SAPID =

IV_REPORT_TYPE = 'AL'

IMPORTING

  • EV_VARIANT =

ET_RETURN = ET_RET

  • EV_SAPID =

.

WRITE : /'SUCCESS'.

Former Member
0 Kudos

i cam't use this because wa_val-low is haveing LOCL value while debuging ...but when /OSP/CREATE_UPDATE_VARIANT this FM is getting called at that time i think is getting changed from LOCL to $LOCL.....

Former Member
0 Kudos

enter ur program in debugging mode then goto inside the FM and execute step by step to see whr exactly the problem is occuring

Former Member
0 Kudos

Thank you all.

My problem is get solved.

instead of giving LOCL in WA_VAL-LOW = 'LOCL'. i have to give WA_VAL-LOW = 'LOCA'.

Then it is not taking $ .

~ Anuja