Application Development 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: 

pnp report

Former Member
0 Kudos

Input is state( infotype 0006).Output PERNR,NAME,STATE CODE,TATE NAME,

COUNTRY CODE,COUNTRY NAME ,and sort by state.

can any one help me out.

Thanks & Regards

KAVITHA

10 REPLIES 10

Former Member
0 Kudos

Hi,

What do you want from us.

Regards,

Atish

Former Member
0 Kudos

Hi

write a select query based on the state in where condition

SELECT PERNR,NAME,STATE CODE,TATE NAME,

COUNTRY CODE,COUNTRY NAME from table

into table iatb

where state = P_state.

any thing elase you want from this

Reward if usefull

0 Kudos

Hi ,

With out itab it is working if i will take evrey thing in itab it is camming problem iam unable to put where condition and sort iam unable to do.Kindly help me out.

REPORT Z_JSU_BSP .

tables : pernr,t005u,t005t.

infotypes : 0006,

0001.

*data: t001 like standard table of t001 with header line.

data : w_bezei like t005u-bezei,

w_landx like t005t-landx.

  • Data : begin of itab occurs 0,

  • pernr like p0006-pernr,

  • ename like p0001-ename,

  • state like p0006-state,

  • land1 like p0006-land1,

  • bukrs like p0001-bukrs,

  • bezei like t005u-bezei,

  • landx like t005t-landx,

  • butxt like t001-butxt,

  • end of itab.

select-options : state for p0006-state.

get pernr.

*provide.

rp_provide_from_last p0006 space pn-begda pn-endda.

if pnp-sw-found = 1.

*if pnp-sw-found eq 1.

*

  • if state = ' '.

  • move-corresponding p0006 to itab.

*

rp_provide_from_last p0001 space pn-begda pn-endda.

*if p0001-bukrs = t001-bukrs .

select single bezei from t005u into w_bezei where land1 = p0006-land1.

select single landx from t005t into w_landx where land1 = p0006-land1.

*write : / w_butxt.

*endif.

if pnp-sw-found = 1.

*write : / sy-vline,

  • 2 pernr-pernr,

  • 17 sy-vline,

  • 18 p0001-ename,

  • 36 sy-vline,

  • 37 p0006-state,

  • 40 sy-vline,

  • 41 p0006-land1,

  • 44 sy-vline,

  • 45 w_bezei,

  • 60 sy-vline,

  • 61 w_landx.

write : / sy-vline,

2 p0006-pernr,

17 sy-vline,

18 p0001-ename,

36 sy-vline,

37 p0006-state,

40 sy-vline,

41 p0006-land1,

44 sy-vline,

45 w_bezei,

60 sy-vline,

61 w_landx.

else.

message e999(zjsu1).

endif.

endif.

0 Kudos

Hi,

It is urjent kindly help me out.

from

Kavitha

Former Member
0 Kudos

Hi Kutti,

Please correct your program accordingly.

I have corrected your program. You can those changes in bold.

REPORT Z_JSU_BSP .

tables : pernr,t005u,t005t.

infotypes : 0006,

0001.

*data: t001 like standard table of t001 with header line.

data : w_bezei like t005u-bezei,

w_landx like t005t-landx.

  • Data : begin of itab occurs 0,

  • pernr like p0006-pernr,

  • ename like p0001-ename,

  • state like p0006-state,

  • land1 like p0006-land1,

  • bukrs like p0001-bukrs,

  • bezei like t005u-bezei,

  • landx like t005t-landx,

  • butxt like t001-butxt,

  • end of itab.

select-options : state for p0006-state,

s_pernr for p0006-pernr.

get pernr.

*provide.

rp_provide_from_last p0006 space pn-begda pn-endda.

if pnp-sw-found = 1.

*if pnp-sw-found eq 1.

*

  • if state = ' '.

  • move-corresponding p0006 to itab.

*

rp_provide_from_last p0001 space pn-begda pn-endda.

*if p0001-bukrs = t001-bukrs .

<b>select single bezei from t005u into w_bezei where spras = sy-langu and

land1 = p0006-land1 and

bland = p0006-state.

select single landx from t005t into w_landx where spras = sy-langu and

land1 = p0006-land1.</b>*write : / w_butxt.

*endif.

if pnp-sw-found = 1.

*write : / sy-vline,

  • 2 pernr-pernr,

  • 17 sy-vline,

  • 18 p0001-ename,

  • 36 sy-vline,

  • 37 p0006-state,

  • 40 sy-vline,

  • 41 p0006-land1,

  • 44 sy-vline,

  • 45 w_bezei,

  • 60 sy-vline,

  • 61 w_landx.

<b>write : / sy-vline,

2 p0006-pernr,

17 sy-vline,

18 p0001-ename,

36 sy-vline,

37 p0006-state,

40 sy-vline,

41 w_bezei,

62 sy-vline,

63 p0006-land1,

71 sy-vline,

72 w_landx,

86 sy-vline.

else.

message e999(zjsu1).

endif.

endif.</b>

0 Kudos

Hi,

In this STATE field is not displaying can any one help me out

&----


*& Report Z_JSU_BSP *

*& *

&----


*& *

*& *

&----


REPORT Z_JSU_BSP .

tables : pernr,t005u,t005t.

infotypes : 0006,

0001.

*data: t001 like standard table of t001 with header line.

data : w_bezei like t005u-bezei,

w_landx like t005t-landx.

Data : begin of itab occurs 0,

pernr like pernr-pernr,

ename like pernr-ename,

state like p0006-state,

land1 like p0006-land1,

bezei like t005u-bezei,

landx like t005t-landx,

  • butxt like t001-butxt,

end of itab.

selection-screen : begin of block b1.

select-options : s_state for p0006-state.

selection-screen : end of block b1.

initialization.

p0006-state = s_state-low.

p0006-state = s_state-high.

start-of-selection.

get pernr.

provide * from p0006 between pn-begda and pn-endda where p0006-state = s_state-low and p0006-state = s_state-high.

endprovide.

select single bezei from t005u into w_bezei where land1 = p0006-land1.

select single landx from t005t into w_landx where land1 = p0006-land1.

move p0006-state to itab-state.

move pernr-pernr to itab-pernr.

move p0006-land1 to itab-land1.

move pernr-ename to itab-ename.

move w_bezei to itab-bezei.

move w_landx to itab-landx.

append itab.

end-of-selection.

*rp_provide_from_last p0006 space pn-begda pn-endda.

*if pnp-sw-found = 1.

*

**if pnp-sw-found eq 1.

**

    • if state = ' '.

    • move-corresponding p0006 to itab.

**

*

*

*rp_provide_from_last p0001 space pn-begda pn-endda.

**if p0001-bukrs = t001-bukrs .

*

*select single bezei from t005u into w_bezei where land1 = p0006-land1.

  • select single landx from t005t into w_landx where land1 = p0006-land1.

*write : / w_butxt.

*endif.

*if pnp-sw-found = 1.

*write : / sy-vline,

  • 2 pernr-pernr,

  • 17 sy-vline,

  • 18 p0001-ename,

  • 36 sy-vline,

  • 37 p0006-state,

  • 40 sy-vline,

  • 41 p0006-land1,

  • 44 sy-vline,

  • 45 w_bezei,

  • 60 sy-vline,

  • 61 w_landx.

sort itab by state.

loop at itab.

write : / sy-vline,

2 itab-pernr,

17 sy-vline,

18 itab-ename,

36 sy-vline,

37 itab-state,

40 sy-vline,

41 itab-land1,

44 sy-vline,

45 itab-bezei,

60 sy-vline,

61 itab-landx.

endloop.

  • else.

  • message e999(zjsu1).

  • endif.

  • endif.

  • endif.

  • write : /55 t001-butxt.

*endif.

top-of-page .

write : / sy-vline ,2 'Emp no',17 sy-vline,18 'ename',36 sy-vline,37 'state' ,40 sy-vline,41 'land',44 sy-vline, 45 'statname',60 sy-vline ,

61 'contryname'.

write : / sy-uline.

0 Kudos

Please it is urjent can any one help me out

Thanks & Regards

Kavitha

0 Kudos

Hi Kavitha

Please check this piece of code ...

&----


*& Report Z_JSU_BSP *

*& *

&----


*& *

*& *

&----


REPORT Z_JSU_BSP .

tables : pernr,t005u,t005t.

infotypes : 0006,

0001.

*data: t001 like standard table of t001 with header line.

data : w_bezei like t005u-bezei,

w_landx like t005t-landx.

Data : begin of itab occurs 0,

pernr like pernr-pernr,

ename like pernr-ename,

state like p0006-state,

land1 like p0006-land1,

bezei like t005u-bezei,

landx like t005t-landx,

  • butxt like t001-butxt,

end of itab.

selection-screen : begin of block b1.

select-options : s_state for p0006-state.

selection-screen : end of block b1.

start-of-selection.

get pernr.

provide * from p0006 between pn-begda and pn-endda where state in s_state.

endprovide.

select single bezei from t005u into w_bezei where land1 = p0006-land1.

select single landx from t005t into w_landx where land1 = p0006-land1.

move p0006-state to itab-state.

move pernr-pernr to itab-pernr.

move p0006-land1 to itab-land1.

move pernr-ename to itab-ename.

move w_bezei to itab-bezei.

move w_landx to itab-landx.

append itab.

end-of-selection.

sort itab by state.

loop at itab.

write : / sy-vline,

2 itab-pernr,

17 sy-vline,

18 itab-ename,

36 sy-vline,

37 itab-state,

40 sy-vline,

41 itab-land1,

44 sy-vline,

45 itab-bezei,

60 sy-vline,

61 itab-landx.

endloop.

top-of-page .

write : / sy-vline ,2 'Emp no',17 sy-vline,18 'ename',36 sy-vline,37 'state' ,40 sy-vline,41 'land',44 sy-vline, 45 'statname',60 sy-vline ,

61 'contryname'.

write : / sy-uline.

~Ranganath

Reward points for useful answers !!

0 Kudos

Hi ,

It is comming but it is not taking the range .with in the range it is not displaying.

Thanks & Regards

Kavitha

0 Kudos

Hi,

Please can any one help me out