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 Logic

Former Member
0 Likes
796

Hi,

I have a requirement for developing a report where will have 4 selection screen parameters like ASN number. ship to party, date range and one more parameter.

Now whenever user make any selection out of these paramters it should bring ASN details, if user enter ship-to-party then all the relevant ASN number should get displayed.

Can anyone tell me how to write the code for such filteration.

Regards

Rinku

Hi,

I have a requirement for developing a report where will have 4 selection screen parameters like ASN number. ship to party, date range and one more parameter.

Now whenever user make any selection out of these paramters it should bring ASN details, if user enter ship-to-party then all the relevant ASN number should get displayed.

Can anyone tell me how to write the code for such filteration.

Regards

Rinku

4 REPLIES 4
Read only

Former Member
0 Likes
766

select-options : s_asn for table-asn,

s_shipto for table-shipto,

s_date for sy-datum.

select field1 field2 fron table into INTERNAL table where asn in s_asn and shipto in s_shipto and date in s_date.

Thanks

mAHESH

Read only

Former Member
0 Likes
766

Rinku

Search the forum for threads that talk about function modules DYNP_VALUES_READ and DYNP_VALUES_UPDATE - some of the threads have good examples. These FMs can be used in your AT SELECTION-SCREEN OUTPUT event to read and set selection screen fields.

Regards

Glen

Read only

Former Member
0 Likes
766

selection-screen parameters ASN STP DR XYZ.

select ASN from <table name> into table <itab> where STP = ....

or DR = ....

or XYZ = ....

regards,

srinivas

<b>*reward for useful answers*</b>

Read only

Former Member
0 Likes
766

Rinku if you are talking about F4 help...here is a smal example..

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

  • SELECTION SCREEN *

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

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.

PARAMETER : P_ZEXTPO TYPE ZPTRI-ZEXTPO,

P_ZMODEL TYPE ZPTRI-ZMODEL.

SELECTION-SCREEN END OF BLOCK b.

PARAMETER P_TEST AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK A.

*----


  • At Selection Screen Event *

*----


AT SELECTION-SCREEN.

  • Validate screen entry

IF P_ZEXTPO IS INITIAL. .

MESSAGE E000(ZV) WITH 'Must enter External PO Number!'.

ENDIF.

*----


  • At Selection Screen ON VALUE-REQUEST FOR f Event *

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ZEXTPO.

PERFORM LIST_VALUES_ZEXTPO.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ZMODEL.

PERFORM LIST_VALUES_ZMODEL.

&----


*& Form LIST_VALUES_ZEXTPO

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM LIST_VALUES_ZEXTPO .

  • Type declaration

TYPES: BEGIN OF TX_ZEXTPO,

ZTRAN TYPE ZZTRAN,

ZTRAN_ITEM TYPE ZZTRAN_ITEM,

ZEXTPO TYPE ZZEXT_PONUMBER,

ZMODEL TYPE ZZMODEL,

END OF TX_ZEXTPO.

  • Data Declaration

DATA: LIT_ZEXTPO TYPE STANDARD TABLE OF TX_ZEXTPO,

LT_DDSHRETVAL TYPE TABLE OF DDSHRETVAL,

LX_ZEXTPO TYPE TX_ZEXTPO,

LX_DDSHRETVAL TYPE DDSHRETVAL.

  • Constant Declaration

CONSTANTS LC_STRUCTURE TYPE CHAR1 VALUE 'S'.

if not P_ZMODEL is INITIAL.

SELECT ZTRAN

ZTRAN_ITEM

ZEXTPO

ZMODEL

FROM ZPTRI INTO TABLE LIT_ZEXTPO

WHERE ZEKORG = 'AU01'

AND ZMODEL = P_ZMODEL.

else.

  • get trans no,Item Ext po and model for F4

SELECT ZTRAN

ZTRAN_ITEM

ZEXTPO

ZMODEL

FROM ZPTRI INTO TABLE LIT_ZEXTPO

WHERE ZEKORG = 'AU01'

AND ZEXTPO = P_ZEXTPO.

endif.

*F4 help also returning the value to be displayed in internal table

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'ZEXTPO'

VALUE_ORG = LC_STRUCTURE

TABLES

VALUE_TAB = LIT_ZEXTPO

RETURN_TAB = LT_DDSHRETVAL

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

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

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

ELSE.

  • get the selected data

READ TABLE LT_DDSHRETVAL INDEX 1 INTO LX_DDSHRETVAL.

P_ZEXTPO = LX_DDSHRETVAL-FIELDVAL.

ENDIF.

ENDFORM. " LIST_VALUES_ZEXTPO

&----


*& Form LIST_VALUES_ZMODEL

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM LIST_VALUES_ZMODEL .

  • Type declaration

TYPES: BEGIN OF TX_ZMODEL,

ZTRAN TYPE ZZTRAN,

ZTRAN_ITEM TYPE ZZTRAN_ITEM,

ZEXTPO TYPE ZZEXT_PONUMBER,

ZMODEL TYPE ZZMODEL,

END OF TX_ZMODEL.

  • Data Declaration

DATA: LIT_ZMODEL TYPE STANDARD TABLE OF TX_ZMODEL,

LT_DDSHRETVAL TYPE TABLE OF DDSHRETVAL,

LX_ZMODEL TYPE TX_ZMODEL,

LX_DDSHRETVAL TYPE DDSHRETVAL.

  • Constant Declaration

CONSTANTS LC_STRUCTURE TYPE CHAR1 VALUE 'S'.

  • get trans no,Item Ext po and model for F4

SELECT ZTRAN

ZTRAN_ITEM

ZEXTPO

ZMODEL

FROM ZPTRI INTO TABLE LIT_ZMODEL

WHERE ZEKORG = 'AU01'

AND ZEXTPO = P_ZEXTPO.

  • and ZMODEL = P_ZMODEL.

*F4 help also returning the value to be displayed in internal table

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'ZMODEL'

VALUE_ORG = LC_STRUCTURE

TABLES

VALUE_TAB = LIT_ZMODEL

RETURN_TAB = LT_DDSHRETVAL

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

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

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

ELSE.

  • get the selected data

READ TABLE LT_DDSHRETVAL INDEX 1 INTO LX_DDSHRETVAL.

P_ZMODEL = LX_DDSHRETVAL-FIELDVAL.

ENDIF.

ENDFORM. " LIST_VALUES_ZMODEL