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

report

Former Member
0 Likes
1,951

plz check it its going to dump, plz correct my prgm

REPORT ZZTEST_PRGM .

data : begin of it_mara occurs 0 ,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

mtart like mara-mtart,

mbrsh like mara-mbrsh,

matkl like mara-matkl,

meins like mara-meins,

end of it_mara.

start-of-selection.

select matnr ersda ernam mtart mbrsh matkl meins from mara into table

it_mara .

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'c:\ mara.txt'

  • FILETYPE = 'ASC'

tables

data_tab = it_mara.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at it_mara.

write 😕 it_mara-matnr, it_mara-ersda, it_mara-ernam, it_mara-mtart.

endloop.

22 REPLIES 22
Read only

Former Member
0 Likes
1,917

Plz tell DUMP detail from error analysis.

rgds

rajesh

Read only

Former Member
0 Likes
1,917

hi,

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'c:\ mara.txt' - You can always use capital letter inside the quote

FILETYPE = 'ASC'

tables

data_tab = it_mara.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

use file type as 'DAT' and uncommand it.

thnks and rgds,

raghul

Read only

0 Likes
1,917

STILL ITS GOING TO DUMP WHY ITS LIKE THAT CANU REASON

Read only

0 Likes
1,917

Gopal,

can you not give Dump Imformation from Error Analysis?

It would be better for us to Know about Dump.

as your code seems OK as everybody says.

Pls paste here dump information.

Amit.

Read only

GauthamV
Active Contributor
0 Likes
1,917

hi,

plz check again.

code is working fine.

just change

IF sy-subrc 0.

as

IF sy-subrc <> 0.

Read only

Former Member
0 Likes
1,917

Hi,

filename = 'c:\ mara.txt'

give c:\ mara.txt in capitals

Reagrds,

Nishant

Read only

Former Member
0 Likes
1,917

Hi,

Can you plz send ur dump analysis.

Read only

Former Member
0 Likes
1,917

Hi Gopal Krishna,

You have declared in your program in this way for that reason its going for short dump.

  • IF sy-subrc eq 0.

*

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  • ENDIF.

*

Change it

IF sy-subrc ne 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Sravanthi

Read only

0 Likes
1,917

hi ,

plz check my code and correct it i am not getting the output but executing properly but no data is displaying plz correct it .

TABLES : anla,

ra02s,

anlz,

anlb.

**************************************************************

  • D A T A D E C L A R A T I O N

**************************************************************

data : begin of it_anla occurs 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

txt50 LIKE anla-txt50,

menge like anla-menge,

aktiv like anla-aktiv,

end of it_anla.

data : begin of it_anlz occurs 0,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

end of it_anlz.

data : begin of it_anlb occurs 0,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

end of it_anlb.

selection-screen begin of block b1 with frame title text-001.

parameter : p_bukrs like it_anla-bukrs.

selection-screen end of block b1.

START-OF-SELECTION.

PERFORM retrieve_data.

PERFORM display_data.

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select gsber kostl werks stort from anlz into table it_anlz

for all entries in it_anla where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select ndjar ndper from anlb into table it_anlb

for all entries in it_anla where bukrs = it_anla-bukrs.

endform. " retrieve_data

form display_data.

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv, it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

endform. " display_data

Read only

Former Member
0 Likes
1,917

Hi Gopal,

The program is functioning properly.

Tell the details what error are u facing.

On my system, the report is producing output like :

400-433 23.05.1995 D002772 ROH

400-500 24.05.1995 D002772 HALB

400-510 24.05.1995 D002772 HAWA

400-511 24.05.1995 D002772 HAWA

400-512 24.05.1995 D002772 HAWA

400-513 24.05.1995 D002772 HAWA

400-520 24.05.1995 D002772 HAWA

400-521 24.05.1995 D002772 HAWA

400-522 24.05.1995 D002772 HAWA

400-523 24.05.1995 D002772 HAWA

400-600 24.05.1995 D002772 ROH

400-700 24.05.1995 D002772 ROH

ACT-DCD-15 30.04.2003 RENDES FERT

ACT-DCD-16 30.04.2003 RENDES FERT

ACT-DCD-17 30.04.2003 RENDES FERT

ACT-DCD-18 30.04.2003 RENDES FERT

ACT-DCD-19 30.04.2003 RENDES FERT

ACT-DCD-20 30.04.2003 RENDES FERT

ACT-DCD-21 30.04.2003 RENDES FERT

ACT-DCD-22 30.04.2003 RENDES FERT

ACT-DCD-23 30.04.2003 RENDES FERT

ACT-DCD-24 30.04.2003 RENDES FERT

ACT-DCD-25 30.04.2003 RENDES FERT

ACT-DCD-26 30.04.2003 RENDES FERT

1368 13.07.2006 D000145 HIBE

1387 31.08.2006 D041761 FHMI

1388 31.08.2006 D041761 FHMI

1389 31.08.2006 D041761 FHMI

1397 22.09.2006 I013793 HIBE

1398 22.09.2006 I013793 HIBE

1399 22.09.2006 I013793 HIBE

like so on...

and mara.txt is being creatd properly.

Regards,

Sachin

Read only

0 Likes
1,917

hi ,

plz check my code and correct it i am not getting the output but executing properly but no data is displaying plz correct it .

TABLES : anla,

ra02s,

anlz,

anlb.

**************************************************************

  • D A T A D E C L A R A T I O N

**************************************************************

data : begin of it_anla occurs 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

txt50 LIKE anla-txt50,

menge like anla-menge,

aktiv like anla-aktiv,

end of it_anla.

data : begin of it_anlz occurs 0,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

end of it_anlz.

data : begin of it_anlb occurs 0,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

end of it_anlb.

selection-screen begin of block b1 with frame title text-001.

parameter : p_bukrs like it_anla-bukrs.

selection-screen end of block b1.

START-OF-SELECTION.

PERFORM retrieve_data.

PERFORM display_data.

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select gsber kostl werks stort from anlz into table it_anlz

for all entries in it_anla where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select ndjar ndper from anlb into table it_anlb

for all entries in it_anla where bukrs = it_anla-bukrs.

endform. " retrieve_data

form display_data.

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv, it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

endform. " display_data

Read only

Former Member
0 Likes
1,917

Hi,

There is no dump but you have syntax error at IF sy-subrc 0.Use Operator symbol(<> / 😃

Thanks

Sudharshan

Read only

Former Member
0 Likes
1,917

Hi,

Check file type, and use caps in the quotes.

Thanks,

Das....

Read only

Former Member
0 Likes
1,917

Hi.

filename = 'c:\ mara.txt'

i am not sure but try to write this path in uppercase.

Read only

naveen_inuganti2
Active Contributor
0 Likes
1,917

Hi....

Gopal....

What ever you pasted here that is exactly correct.. no chance to go into runtime....

No need to mention file name in capital letters...

Iam sure...

data : begin of it_mara occurs 0 ,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

mtart like mara-mtart,

mbrsh like mara-mbrsh,

matkl like mara-matkl,

meins like mara-meins,

end of it_mara.

start-of-selection.

select matnr ersda ernam mtart mbrsh matkl meins from mara into table

it_mara .

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'c:\ mara.txt'

FILETYPE = 'ASC'

tables

data_tab = it_mara.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at it_mara.

write 😕 it_mara-matnr, it_mara-ersda, it_mara-ernam, it_mara-mtart.

endloop.

I tried with this code.. giving list and file in C drive....

You must come back here with your error description... Other wise, Plz don't repeat it again with out proper checking...

Thanks,

Naveen Inuganti.

Read only

0 Likes
1,917

HI,

i am getting o/p but in c drive the file is not downloading

Read only

Former Member
0 Likes
1,917

hi,

Code seems to be fine. Please Check your Basis Guy wheather you have the rights to create a File On C Drive. Try to change the Drive and Check.

Reagrds

Sumit Agarwal

Read only

Former Member
0 Likes
1,917
REPORT zztest_prgm .

DATA : BEGIN OF it_mara OCCURS 0 ,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
ernam LIKE mara-ernam,
mtart LIKE mara-mtart,
mbrsh LIKE mara-mbrsh,
matkl LIKE mara-matkl,
meins LIKE mara-meins,
END OF it_mara.

START-OF-SELECTION.
  SELECT matnr ersda ernam mtart mbrsh matkl meins FROM mara INTO TABLE
  it_mara up to 10 rows.
"*if file is open and you are writing it then it will give
" dump , that too in Older versions, in latest versions 
" it is not happening like that.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename = 'c:\ mara.txt'
      filetype = 'ASC'
    TABLES
      data_tab = it_mara.
  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  LOOP AT it_mara.
    WRITE :/ it_mara-matnr, 
                  it_mara-ersda,
                 it_mara-ernam, 
                it_mara-mtart.
  ENDLOOP.

There is no issue with your coding, it is working fine in my system.

Read only

Former Member
0 Likes
1,917

Hi!

Check your program


REPORT zztest_prgm .

DATA : BEGIN OF it_mara OCCURS 0 ,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
ernam LIKE mara-ernam,
mtart LIKE mara-mtart,
mbrsh LIKE mara-mbrsh,
matkl LIKE mara-matkl,
meins LIKE mara-meins,
END OF it_mara.

START-OF-SELECTION.
  SELECT matnr
         ersda
         ernam
         mtart
         mbrsh
         matkl
         meins
    FROM mara INTO TABLE it_mara .

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename = 'C:\MARA.TXT'
      filetype = 'ASC'
    TABLES
      data_tab = it_mara.

  IF sy-subrc NE 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSEIF sy-subrc EQ 0.
    WRITE: 'DATA DOWNLOADED'.

  ENDIF.


  LOOP AT it_mara.
    WRITE :/ it_mara-matnr, it_mara-ersda, it_mara-ernam, it_mara-mtart.
  ENDLOOP.

Regards

Abhijeet

Read only

Former Member
0 Likes
1,917

f

Read only

Former Member
0 Likes
1,917

check for occurs 0,

some times mistakes will be occuring over there

Read only

Former Member
0 Likes
1,917

hi ,

plz check my code and correct it i am not getting the output but executing properly but no data is displaying plz correct it .

TABLES : anla,

ra02s,

anlz,

anlb.

**************************************************************

D A T A D E C L A R A T I O N

**************************************************************

data : begin of it_anla occurs 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

txt50 LIKE anla-txt50,

menge like anla-menge,

aktiv like anla-aktiv,

end of it_anla.

data : begin of it_anlz occurs 0,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

end of it_anlz.

data : begin of it_anlb occurs 0,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

end of it_anlb.

selection-screen begin of block b1 with frame title text-001.

parameter : p_bukrs like it_anla-bukrs.

selection-screen end of block b1.

START-OF-SELECTION.

PERFORM retrieve_data.

PERFORM display_data.

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select gsber kostl werks stort from anlz into table it_anlz

for all entries in it_anla where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select ndjar ndper from anlb into table it_anlb

for all entries in it_anla where bukrs = it_anla-bukrs.

endform. " retrieve_data

form display_data.

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv, it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

endform. " display_data