2007 May 17 3:43 PM
Hi all,
I am giving filepath as parameter in lower case but it is changing to upper case in runtime. As the file path is case sensitive i am not able to upload the data into application server. kindly tell me how to covert that parameter to lower case.
pls help me. its urgent.
Thanks,
Praveena
2007 May 17 3:51 PM
Hi,
it doesnt happen even if parameter value is changing to upper case in runtime.
i wanna have a look on ur code..
Regards
Naveen
2007 May 17 3:54 PM
hi naveen ,
here is my code.
thanks,
Praveena
REPORT ZDOWNLOAD MESSAGE-ID Y_FI
LINE-SIZE 150 NO STANDARD PAGE HEADING.
----
T A B L E S
----
*Tables
Tables: YCOSTCTR, " To maintain Substitution data for Cost Centers
KNVV. " Customer Master Sales Data
----
T A B L E T Y P E S
----
TYPES: BEGIN OF ty_final,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
EIKTO TYPE EIKTO, "Shipper's(Our)Acc No.at the Customer or Vendor
leg_dep(4) type c, "Legacy Department
END OF ty_final.
TYPES: BEGIN OF ty_ycostctr,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
leg_dep(4) type c, "Legacy Department
END OF ty_ycostctr.
TYPES: BEGIN OF ty_ycostctr1,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
END OF ty_ycostctr1.
TYPES: BEGIN OF ty_knvv,
KUNNR TYPE KUNNR, "Customer Number 1
EIKTO TYPE EIKTO, "Shipper's(Our)Acc No.at the Customer or Vendor
END OF ty_knvv.
----
I N T E R N A L T A B L E S
----
DATA: tb_ycostctr TYPE STANDARD TABLE OF ty_ycostctr.
DATA: tb_ycostctr1 TYPE STANDARD TABLE OF ty_ycostctr1.
DATA: tb_knvv TYPE STANDARD TABLE OF ty_knvv.
final internal table to upload into application server
DATA: tb_final TYPE STANDARD TABLE OF ty_final.
----
W O R K A R E A S
----
DATA: wa_ycostctr TYPE ty_ycostctr.
DATA: wa_ycostctr1 TYPE ty_ycostctr1.
DATA: wa_knvv TYPE ty_knvv.
DATA: wa_final TYPE ty_final.
----
V A R I A B L E S
----
DATA:
l_filenm LIKE filename-fileintern,
logical file name for interface
c_lg_ar LIKE filename-fileintern VALUE 'Z_21767_COSTCTR_INBOUND',
l_out_file(255).
DATA: l_filename TYPE file_name.
----
C O N S T A N T S
----
DATA: e_file like rlgrap-filename value
'usr/sap/interfaces/<SYSID>/inbound/ctmvendor/costctr_inbound.txt'.
----
S E L E C T I O N S C R E E N
----
SELECTION-SCREEN BEGIN OF BLOCK b1 .
PARAMETERS : p_file TYPE filename-fileintern
default 'usr/sap/interfaces/d48/inbound/test_cost'.
SELECTION-SCREEN END OF BLOCK b1.
----
I N I T I A L I Z A T I O N
----
INITIALIZATION.
l_filenm = c_lg_ar.
----
S T A R T - O F - S E L E C T I O N
----
start-of-selection.
to get data into final internal table
PERFORM get_data.
----
E N D - O F - S E L E C T I O N
----
end-of-selection.
PERFORM upload.
----
F O R M S
----
&----
*& Form get_data
&----
text
----
--> p1 text
<-- p2 text
----
form get_data .
select kunwe
kostl
into table tb_ycostctr1
from ycostctr.
Delete adjacent duplicates from tb_ycostctr1 comparing kunwe kostl.
select kunnr
eikto
into table tb_knvv
from knvv
for all entries in tb_ycostctr1
where kunnr = tb_ycostctr1-kunwe.
if sy-subrc = 0.
To get data into final internal table.
loop at tb_ycostctr1 into wa_ycostctr1 .
READ TABLE tb_knvv INTO wa_knvv
WITH KEY kunnr = wa_ycostctr1-kunwe.
if sy-subrc = 0.
wa_final-kunwe = wa_ycostctr1-kunwe.
wa_final-kostl = wa_ycostctr1-kostl.
wa_final-eikto = wa_knvv-eikto.
wa_final-leg_dep = wa_ycostctr1-kostl+6(4).
append wa_final to tb_final.
endif.
endloop.
endif.
endform. " get_data
&----
*& Form upload
&----
text
----
--> p1 text
<-- p2 text
----
form upload .
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING
UTF-8 IGNORING CONVERSION ERRORS.
if sy-subrc = 0.
LOOP AT tb_final INTO wa_final.
TRANSFER wa_final TO p_file .
ENDLOOP.
CLOSE DATASET p_file.
endif.
endform. " upload
2007 May 17 4:11 PM
Hi,
1. Give filename type as RLGRAP-FILENAME
2. Perform upload statement you are not passing p_file...
Correct these two and check...
Regards,
Azaz Ali.
2007 May 17 4:20 PM
Hi Azaz,
I tried ur solution but it is not getting. pls help me.
thanks,
Praveena
2007 May 17 4:31 PM
See the below code :
REPORT ZDOWNLOAD MESSAGE-ID Y_FI
LINE-SIZE 150 NO STANDARD PAGE HEADING.
----
T A B L E S
----
*Tables
Tables: YCOSTCTR, " To maintain Substitution data for Cost Centers
KNVV. " Customer Master Sales Data
----
T A B L E T Y P E S
----
TYPES: BEGIN OF ty_final,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
EIKTO TYPE EIKTO, "Shipper's(Our)Acc No.at the Customer or Vendor
leg_dep(4) type c, "Legacy Department
END OF ty_final.
TYPES: BEGIN OF ty_ycostctr,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
leg_dep(4) type c, "Legacy Department
END OF ty_ycostctr.
TYPES: BEGIN OF ty_ycostctr1,
KUNWE TYPE KUNWE, "Ship-to party
KOSTL TYPE KOSTL, "Cost-Center
END OF ty_ycostctr1.
TYPES: BEGIN OF ty_knvv,
KUNNR TYPE KUNNR, "Customer Number 1
EIKTO TYPE EIKTO, "Shipper's(Our)Acc No.at the Customer or Vendor
END OF ty_knvv.
----
I N T E R N A L T A B L E S
----
DATA: tb_ycostctr TYPE STANDARD TABLE OF ty_ycostctr.
DATA: tb_ycostctr1 TYPE STANDARD TABLE OF ty_ycostctr1.
DATA: tb_knvv TYPE STANDARD TABLE OF ty_knvv.
final internal table to upload into application server
DATA: tb_final TYPE STANDARD TABLE OF ty_final.
----
W O R K A R E A S
----
DATA: wa_ycostctr TYPE ty_ycostctr.
DATA: wa_ycostctr1 TYPE ty_ycostctr1.
DATA: wa_knvv TYPE ty_knvv.
DATA: wa_final TYPE ty_final.
----
V A R I A B L E S
----
DATA:
l_filenm LIKE filename-fileintern,
logical file name for interface
c_lg_ar LIKE filename-fileintern VALUE 'Z_21767_COSTCTR_INBOUND',
l_out_file(255).
DATA: l_filename TYPE file_name.
----
C O N S T A N T S
----
DATA: e_file like rlgrap-filename value
'usr/sap/interfaces/<SYSID>/inbound/ctmvendor/costctr_inbound.txt'.
----
S E L E C T I O N S C R E E N
----
SELECTION-SCREEN BEGIN OF BLOCK b1 .
PARAMETERS : p_file TYPE filename-fileintern
default 'usr/sap/interfaces/d48/inbound/test_cost' LOWER CASE.
SELECTION-SCREEN END OF BLOCK b1.
----
I N I T I A L I Z A T I O N
----
INITIALIZATION.
l_filenm = c_lg_ar.
----
S T A R T - O F - S E L E C T I O N
----
start-of-selection.
to get data into final internal table
PERFORM get_data.
----
E N D - O F - S E L E C T I O N
----
end-of-selection.
PERFORM upload.
----
F O R M S
----
&----
*& Form get_data
&----
text
----
--> p1 text
<-- p2 text
----
form get_data .
select kunwe
kostl
into table tb_ycostctr1
from ycostctr.
Delete adjacent duplicates from tb_ycostctr1 comparing kunwe kostl.
select kunnr
eikto
into table tb_knvv
from knvv
for all entries in tb_ycostctr1
where kunnr = tb_ycostctr1-kunwe.
if sy-subrc = 0.
To get data into final internal table.
loop at tb_ycostctr1 into wa_ycostctr1 .
READ TABLE tb_knvv INTO wa_knvv
WITH KEY kunnr = wa_ycostctr1-kunwe.
if sy-subrc = 0.
wa_final-kunwe = wa_ycostctr1-kunwe.
wa_final-kostl = wa_ycostctr1-kostl.
wa_final-eikto = wa_knvv-eikto.
wa_final-leg_dep = wa_ycostctr1-kostl+6(4).
append wa_final to tb_final.
endif.
endloop.
endif.
endform. " get_data
&----
*& Form upload
&----
text
----
--> p1 text
<-- p2 text
----
form upload .
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING
UTF-8 IGNORING CONVERSION ERRORS.
if sy-subrc = 0.
LOOP AT tb_final INTO wa_final.
TRANSFER wa_final TO p_file .
ENDLOOP.
CLOSE DATASET p_file.
Reward Points if it is helpful
Thanks
Seshu
2007 May 17 4:36 PM
Hi Praveena,
I tried to execute your code and when i did F8 i see the parameter values still in lower case only. they didn't change for me. Apart from this what i notice is your default value for the path is
usr/sap/interfaces/d48/inbound/test_cost'.
usually there will be '/' in the begining. Check your file path once. It will be like
'/usr/sap/interfaces/d48/inbound/test_cost'.
Award points if it helps.