‎2006 Nov 30 4:33 PM
hi to all,
help me in this issue
in form i am doing like this
if bsid-wears = 'eur'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&
elseif bsid-waers = 'nok'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&.
else
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&.
now my peoblem is i need a space after each currecncy values how can i do it
EUR 12,000.00
EUR 1,000.00
EUR 12,000.00
GBP 20,000.00
GBP 10,000.00
GBP 5,000.00
USD 10,000.00
USD 5,000.00
like this
is there any syst command to do this
thanks in advance
kirna kumar
Message was edited by:
kiran kumar
Message was edited by:
kiran kumar
Message was edited by:
kiran kumar
‎2006 Nov 30 6:18 PM
Hi,
Did the you add the code that I mentioned in my earlier post..
curr_stc = v_curr.
Please add that it should work fine..
Also it will work if the internal table is sorted with currency field WAERS..
Thanks,
Naren
‎2006 Nov 30 4:38 PM
Hi,
If you need a blank line use / .
/
P1if bsid-wears = 'eur'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&
Thanks,
Naren
‎2006 Nov 30 4:40 PM
hi narendren i dont need after each and every line item i need after all values of particular currency.
thanks in advance
kiran kumar
‎2006 Nov 30 5:06 PM
Hi,
If you can change the print program..
Do the following..
IF the currency changes with in the loop..
Then the write_form function module to have a blank line..
Example..
-
Sapscript
-
/E NEW_LINE
/
Print program
-
IF the currency changes..
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'NEW_LINE'
WINDOW = 'MAIN'.
Thanks,
Naren
‎2006 Nov 30 5:09 PM
hi narendran,
it is a standard print program i cant change that is ther any other alternative
thanks in advance
kiran kumar
‎2006 Nov 30 5:10 PM
If you need a blank line use / .
/
PLIF BSID-WAERS = 'EUR'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&BSID-WAERS&
Message was edited by:
Ramesh Babu Chirumamilla
‎2006 Nov 30 5:13 PM
hi i dont need after each and every line item i need a space after line items of one currency r over.
thanks in advance
kiran kumar
‎2006 Nov 30 5:19 PM
Hi,
Try this ....
Sap script form
-
/: DEFINE &V_NEWLINE& := ''
/: PERFORM CHECK_NEW_CURR IN PROGRAM Z_REPORT_SUB
/: USING &BSID-WAERS&
/: CHANGING &V_NEWLINE&
/: ENDPERFORM
/: IF &V_NEWLINE& = 'X'
/
/: ENDIF
Create a new report program Z_REPORT_SUB and have the following code
-
FORM check_new_curr TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
STATICS: v_curr_stc LIKE bsid-waers.
DATA: v_curr LIKE bsid-waers.
Get the input parameter
READ TABLE in_par WITH KEY 'BSID-WAERS'.
CHECK sy-subrc = 0.
v_curr = in_par-value.
Get the output parameter
READ TABLE out_par WITH KEY 'V_NEWLINE'.
CHECK sy-subrc = 0.
IF the currency is not equal to previous curr in the variable
V_CURR_STC..If so set the flag to 'X'.
IF v_curr <> v_curr_stc.
out_par-value = 'X'.
MODIFY out_par INDEX sy-tabix.
ENDIF.
ENDFORM.
Thanks,
Naren
‎2006 Nov 30 5:29 PM
hi narendran thanks for ur answer i will try this.
one dought
should i keep the condition
if new-line 'x'
blank
endif
before the if conditons or last
thanks
kiran kumar
Message was edited by:
kiran kumar
‎2006 Nov 30 5:30 PM
‎2006 Nov 30 5:36 PM
Hi,
You should have it before the if the conditions..
Have my code here (means before the IF conditions)..
<b>if bsid-wears = 'eur'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&
elseif bsid-waers = 'nok'
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&.
else
&BSID-BLDAT&,,&G_NETDT& &RF140-BELEGNUM(20)&,,&BSID-SGTXT(17)&
&bsid-waers&.</b>
Thanks,
Naren
‎2006 Nov 30 5:58 PM
hi narendren for every record it v_newline is becoming x
and there is no differnce in output.
thanks in advance
kiran kumar
‎2006 Nov 30 5:52 PM
Hi,
I missed this line...
Please add in the program....The changes are marked in bold..
FORM check_new_curr TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
STATICS: v_curr_stc LIKE bsid-waers.
DATA: v_curr LIKE bsid-waers.
Get the input parameter
READ TABLE in_par WITH KEY 'BSID-WAERS'.
CHECK sy-subrc = 0.
v_curr = in_par-value.
Get the output parameter
READ TABLE out_par WITH KEY 'V_NEWLINE'.
CHECK sy-subrc = 0.
IF the currency is not equal to previous curr in the variable
V_CURR_STC..If so set the flag to 'X'.
IF v_curr <> v_curr_stc.
out_par-value = 'X'.
MODIFY out_par INDEX sy-tabix.
ENDIF.
<b>v_curr_stc = v_curr.</b>
ENDFORM.
Thanks,
Naren
‎2006 Nov 30 6:03 PM
Hi,
Check this change..As mentioned in my last post..
I missed this line...
Please add in the program....The changes are marked in bold..
FORM check_new_curr TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
STATICS: v_curr_stc LIKE bsid-waers.
DATA: v_curr LIKE bsid-waers.
Get the input parameter
READ TABLE in_par WITH KEY 'BSID-WAERS'.
CHECK sy-subrc = 0.
v_curr = in_par-value.
Get the output parameter
READ TABLE out_par WITH KEY 'V_NEWLINE'.
CHECK sy-subrc = 0.
IF the currency is not equal to previous curr in the variable
V_CURR_STC..If so set the flag to 'X'.
IF v_curr <> v_curr_stc.
out_par-value = 'X'.
MODIFY out_par INDEX sy-tabix.
ENDIF.
<b>v_curr_stc = v_curr.</b>
ENDFORM.
Thanks,
Naren
‎2006 Nov 30 6:08 PM
hi naren,
i debugged the script it is going to this subroutine only once at first time and keeping blank at first positon and and nver coming to the subroutine again.
thanks & Regards
kiran kumar
‎2006 Nov 30 6:10 PM
Hi,
Put a break point in the subroutine...
Also are you displaying the contents in the main window..
I checked this code it is working fine for me...
Thanks,
Naren
‎2006 Nov 30 6:15 PM
hi naren,
everytime out_par-value = 'X' is becoming x and not evening keeping blank space
anyway thanks Naren i i will debug it thank u very much for ur help.
thanks in advance
kiran kumar
‎2006 Nov 30 6:18 PM
Hi,
Did the you add the code that I mentioned in my earlier post..
curr_stc = v_curr.
Please add that it should work fine..
Also it will work if the internal table is sorted with currency field WAERS..
Thanks,
Naren
‎2006 Nov 30 6:34 PM
thank you very much narendren the problem was solved
can u give ur mail id narenden.
thanks & regards
kiran kumar.
‎2006 Nov 30 6:36 PM
Hi,
Please get my email-id from my business card..
Thanks,
Naren
‎2006 Nov 30 7:26 PM
hi narenden,
when statics will be decalared in which cases it will declared
thanks in advance
kiran kumar
‎2006 Nov 30 7:30 PM
Hi,
I don't get your question....If you declare the variable as STATICS in a subroutine..Then if the subroutine is called multiple times...The value set in the previous call will be retained..
Thanks,
Naren
‎2006 Nov 30 7:34 PM
‎2006 Nov 30 7:45 PM
hi naren sorry for asking this
if u use data:
how to retain the value.
thanks in advance
kiran kumar
‎2006 Nov 30 7:37 PM
Hi,
IF we <b>data :v_curr_stc how can we retain the value</b>, the value will not be retained...Everytime a new variable will be created...
Thanks,
Naren
‎2006 Nov 30 7:49 PM
Hi,
You cannot retain value using DATA statement in a subroutine..Please let me know your requiement..Why do you want to retain value using DATA statement..
Thanks,
Naren