Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Variant Problem.

ronaldo_aparecido
Contributor
0 Likes
534

Hi Guys.

I created the code :

PARAMETERS: p_arqui TYPE localfile OBLIGATORY.

INITIALIZATION.

   CONCATENATE 'PGTOS_RECARGA_' sy-datum+6(2)

                                sy-datum+4(2)

                                sy-datum(4sy-uzeit '.TXT' INTO p_arqui.

It´s worked the parameter p_arqui showed in screen with value inserted by  initialization (PGTOS_RECARGA_04112013152355.TXT )

, BUT IF I CREATE A VARIANT SCREEN WITH OTHER VALUE FOR P_ARQUI ,FOR EXAMPLE P_ARQUI = TESTE_RONI.

AND I SAVE THIS VARIANT , WHEN I CALL THIS SAME VARIANT THE P_ARQUI APPEARS WITH VALUE PGTOS_RECARGA_04112013152355.TXT

AND NOT WITH valu TESTE_RONI FROM VARIANT.

How to fix this problem?

Thanks for help.



1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
501

Hi.

that's happens because u r always writting the value of p_arqui = PGTOS_RECARGA_04112013152355.TXT.

So you need to do sth like.

if p_arqui is not initial.

   CONCATENATE 'PGTOS_RECARGA_' sy-datum+6(2)

                                sy-datum+4(2)

                                sy-datum(4sy-uzeit '.TXT' INTO p_arqui.

endif.

Check it.

Regards

Miguel

4 REPLIES 4
Read only

Former Member
0 Likes
502

Hi.

that's happens because u r always writting the value of p_arqui = PGTOS_RECARGA_04112013152355.TXT.

So you need to do sth like.

if p_arqui is not initial.

   CONCATENATE 'PGTOS_RECARGA_' sy-datum+6(2)

                                sy-datum+4(2)

                                sy-datum(4sy-uzeit '.TXT' INTO p_arqui.

endif.

Check it.

Regards

Miguel

Read only

Former Member
0 Likes
501

Are you using other events also in the program??

If you are using like:

PARAMETERS: p_arqui TYPE localfile OBLIGATORY.

INITIALIZATION.

CONCATENATE 'PGTOS_RECARGA_' sy-datum+6(2)

                                 sy-datum+4(2)

                                 sy-datum(4sy-uzeit '.TXT' INTO p_arqui.

   START-OF-SELECTION.

  write:/ p_arqui.

It will print the correct value of variable..


Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
501

Can you please explain what exactly shall happen in more detail

Read only

venkat_aileni
Contributor
0 Likes
501

Hi-

I have replicated your scenario in my sample code:

PARAMETERS: p_matnr TYPE mara-matnr.

INITIALIZATION.

MOVE: 'ABC' TO p_matnr.

END-OF-SELECTION.

IF p_matnr IS NOT INITIAL.

   WRITE: p_matnr.

ENDIF.

In the above code: Value 'ABC' is defaulted always, but I have created a variant with value 'XYZ'. When I ran this report it gave me ;XYZ' and not 'ABC'.

-Venkat