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: 

Abt Selection Screen

Former Member
0 Kudos

Hello Experts..

m facing a strange problem..

On my selection screen, I have given 3 select-options for SD No, Item No and WBS Element.

So when I enter range in SD NO along with in Item No and execute the report, it simply neglects the range of Item no and displays all SDs, but when I go back from report to my selection-screen again and then execute the report again, it filters the records based on itm no range.

I debugged the programme and found that no vlue is entering from selection screen in select option for item during first time execution, while its thr when I execute the report second time..

so Any ideas for this..

Ur help will definately appriciated..

Thanks in advance..

11 REPLIES 11

Former Member
0 Kudos

Hi Rashmi ,

First thing is REFRESH all internal tables, If it wont solve ur Problem paste ur code over here.

Regards

Prabhu

aris_hidalgo
Contributor
0 Kudos

Hi Rashmi,

Can you please post your code so we can look at your problem more clearly.

Thanks!

Former Member
0 Kudos

just clear the selection screen after execution.

Former Member
0 Kudos

Thanks to all for your replies

but the problem its not reading the scond select option i.e. for item,

I refreshed all intab along with select options

but the problem is same. ..the values are not getting transferred from the selection screen during 1st execution...

m giving partial code for ur referal here..

TABLES: VBAP,

VBFA,

VBRP.

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

  • Declaration of internal tables *

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

TYPE-POOLS SLIS.

INCLUDE: <ICON>,

<SYMBOL>.

CONSTANTS: GC_FORMNAME_TOP_OF_PAGE TYPE

SLIS_FORMNAME VALUE 'TOP_OF_PAGE',

GC_FORMNAME_USER_COMMAND TYPE

SLIS_FORMNAME VALUE 'USER_COMMAND'.

DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.

DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

IT_SORT TYPE SLIS_T_SORTINFO_ALV,

I_EVENTS TYPE SLIS_T_EVENT,

I_LAYOUT TYPE SLIS_LAYOUT_ALV.

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

  • Declaration of internal table for Sales Doc. Item Data alongwith all

  • related informations

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

data: begin of i_out occurs 0,

vbeln like vbap-vbeln, " Sales document

posnr like vbap-posnr, " Sales document item

ps_psp_pnr like vbap-ps_psp_pnr, " WBS element

prctr like vbap-prctr, " Profit center

matnr like vbap-matnr, " Material number

arktx like vbap-arktx, " Short text for sales order item

kdmat like vbap-kdmat, " Material number used by customer

kwmeng like vbap-kwmeng, " Cumulative ord qty in sal units

netwr like vbap-netwr, " Net value of the order item

waerk like vbap-waerk,

vbelnf like vbfa-vbeln, " Subseq sales & dist document

posnn like vbfa-posnn, " Subseq item of an SD document

VBTYP_N LIKE VBFA-VBTYP_N,

fkart like vbrk-fkart,

fkimg like vbrp-fkimg, " Actual billed quantity

tot_qty like vbrp-fkimg, "Billed Qty for item

diff_qty like vbrp-fkimg, " B Q to be billed

netwr_b like vbrp-netwr,

  • BILL_CURR like vbrp-

TOT_BILL like vbrp-netwr,

DIFF like vbrp-netwr,

kzwi5 like vbrp-kzwi5,

kzwi6 like vbrp-kzwi6,

amt like vbrp-netwr,

tot_amt like vbrp-netwr,

diff_amt like vbrp-netwr,

end of i_out,

CNT TYPE I,

p_f2code type sy-ucomm value '&IC1'.

DATA: I_TEMP LIKE I_OUT OCCURS 0 WITH HEADER LINE,

W_TABIX LIKE SY-TABIX.

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

  • Declaration of internal table for Sales Doc. Item Data alongwith all

  • billing informations

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

DATA: BEGIN OF T_VBRP OCCURS 0,

vbelnf like vbfa-vbeln, " Subseq sales & dist document

posnn like vbfa-posnn, " Subseq item of an SD document

VBTYP_N LIKE VBFA-VBTYP_N,

fkimg like vbrp-fkimg, " Actual billed quantity

netwr_b like vbrp-netwr,

kzwi5 like vbrp-kzwi5,

kzwi6 like vbrp-kzwi6,

  • BILL_CURR like vbrp-

TOT_BILL like vbrp-netwr,

DIFF like vbrp-netwr,

END OF T_VBRP.

data : toutdt like prps-post1,

touttm like prps-post1,

t_vbeln like vbrp-vbeln,

t_posnr like vbrp-posnr,

v_index like sy-index.

  • CNT TYPE N.

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

******************SELECTION SCREEN DECLARATION************************

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

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

selection-screen skip 2.

select-options: s_vbeln for vbap-vbeln ,

s_posnr for vbap-posnr ,

s_wbs for vbap-ps_psp_pnr.

selection-screen skip 2.

selection-screen end of block b1.

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

  • Checking the correction of screen variable for Sales Document No

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

at selection-screen on s_vbeln.

if s_vbeln-low eq '' .

message E001.

endif.

  • if s_vbeln-high eq '' .

  • message E001.

  • endif.

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

  • Checking the correction of screen variable for Item

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

*at selection-screen on s_posnr.

  • if s_posnr-low eq '' or s_posnr-high eq ''.

  • message E002.

  • endif.

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

  • Checking Document No Entered

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

if s_vbeln-low ne ''.

select single vbeln into t_vbeln from vbap

where vbeln = s_vbeln-low.

endif.

if sy-subrc ne 0.

message E003.

endif.

if s_vbeln-high ne ''.

select single vbeln into t_vbeln from vbap

where vbeln = s_vbeln-high.

endif.

if sy-subrc ne 0.

message E003.

endif.

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

  • Checking Sales Document Item No Entered

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

if s_posnr-low ne ''.

select single posnr into t_posnr from vbap

where posnr = s_posnr-low.

endif.

if sy-subrc ne 0.

message E004.

endif.

if s_posnr-high ne ''.

select single posnr into t_posnr from vbap

where posnr = s_posnr-high.

endif.

if sy-subrc ne 0.

message E004.

endif.

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

  • Start-of-selection

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

PERFORM EVENTTAB_BUILD USING I_EVENTS[].

PERFORM E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].

PERFORM FIELD_CATALOG.

PERFORM SORT_ORDER.

PERFORM GUI_STATUS.

  • PERFORM BUILD_LAYOUT USING I_LAYOUT.

PERFORM DETAIL_SELECTION.

I_TEMP[] = I_OUT[].

DELETE I_OUT WHERE VBTYP_N <> 'M' AND

VBTYP_N <> 'O' AND

VBTYP_N <> 'P' AND

VBTYP_N <> 'N'.

cnt = 0.

describe table I_OUT lines cnt.

if cnt > 0.

perform clear_total_order_value.

perform value_selection.

perform value_updation. "Transferring data from T_VBRP to I_OUT

perform calculations.

PERFORM FINAL_BILL.

  • PERFORM CALCULATION.

LOOP AT I_TEMP.

W_TABIX = SY-TABIX.

READ TABLE I_OUT WITH KEY VBELN = I_TEMP-VBELN

POSNR = I_TEMP-POSNR

VBELNF = I_TEMP-VBELNF

POSNN = I_TEMP-POSNN

VBTYP_N = I_TEMP-VBTYP_N.

IF SY-SUBRC NE 0.

INSERT I_TEMP INTO I_OUT INDEX W_TABIX.

ENDIF.

ENDLOOP.

perform display_alv_grid_list.

ELSE.

MESSAGE E005.

ENDIF.

&----


*& Form EVENTTAB_BUILD

&----


  • text

----


  • -->P_I_EVENTS[] text

----


FORM EVENTTAB_BUILD USING T_EVENTS TYPE SLIS_T_EVENT.

DATA LS_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = T_EVENTS

  • EXCEPTIONS

  • LIST_TYPE_WRONG = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

READ TABLE T_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE

INTO LS_EVENT.

IF SY-SUBRC = 0.

MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.

MODIFY T_EVENTS FROM LS_EVENT

TRANSPORTING FORM

where name = slis_ev_top_of_page.

ENDIF.

READ TABLE T_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND

INTO LS_EVENT.

IF SY-SUBRC = 0.

MOVE GC_FORMNAME_USER_COMMAND TO LS_EVENT-FORM.

MODIFY T_EVENTS FROM LS_EVENT

TRANSPORTING FORM

where name = slis_ev_user_command.

ENDIF.

ENDFORM. " EVENTTAB_BUILD

&----


*& Form E04_COMMENT_BUILD

&----


  • text

----


  • -->P_GT_LIST_TOP_OF_PAGE text

----


FORM E04_COMMENT_BUILD USING T_LISTHEADER TYPE SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = 'AREVA T&D'.

APPEND LS_LINE TO T_LISTHEADER.

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

INPUT = SY-DATUM

IMPORTING

OUTPUT = TOUTDT.

.

CALL FUNCTION 'CONVERSION_EXIT_TIMLO_OUTPUT'

EXPORTING

INPUT = SY-UZEIT

IMPORTING

OUTPUT = TOUTTM.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = 'Run Date and Time'.

CONCATENATE TOUTDT '-' TOUTTM INTO LS_LINE-INFO.

APPEND LS_LINE TO T_LISTHEADER.

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = 'INV RECON REPORT'.

APPEND LS_LINE TO T_LISTHEADER.

.

ENDFORM. " E04_COMMENT_BUILD

&----


*& Form FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM FIELD_CATALOG.

DATA :WW_FCAT TYPE SLIS_FIELDCAT_ALV,

COLCNT TYPE I.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'VBELN'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Sales Doc'.

WW_FCAT-seltext_m = 'Sales Doc No'.

WW_FCAT-seltext_l = 'Sales Document No'.

  • WW_FCAT-REPTEXT_DDIC = 'Sales Document'.

WW_FCAT-HOTSPOT = 'X'.

  • WW_FCAT-EMPHASIZE = 'C300'.

    • WW_FCAT-REF_FIELDNAME = 'vbeln'.

WW_FCAT-REF_TABNAME = 'VBAP'.

WW_FCAT-KEY = 'X'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'POSNR'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Item No'.

WW_FCAT-seltext_m = 'Sales Doc Item No'.

WW_FCAT-seltext_l = 'Sales Document Item No'.

  • WW_FCAT-REPTEXT_DDIC = 'Sales Document Item'.

  • WW_FCAT-REF_FIELDNAME = 'posnr'.

WW_FCAT-REF_TABNAME = 'VBAP'.

WW_FCAT-OUTPUTLEN = '12'.

WW_FCAT-KEY = 'X'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'PS_PSP_PNR'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'WBS'.

WW_FCAT-seltext_m = 'WBS Element'.

WW_FCAT-seltext_l = 'WBS Element'.

WW_FCAT-EMPHASIZE = 'C200'.

  • WW_FCAT-REPTEXT_DDIC = 'WBS Element'.

WW_FCAT-OUTPUTLEN = '12'.

  • WW_FCAT-REF_FIELDNAME = 'ps_psp_pnr'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'PRCTR'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Profit Cet'.

WW_FCAT-seltext_m = 'Profit Center'.

WW_FCAT-seltext_l = 'Profit Center'.

WW_FCAT-EMPHASIZE = 'C200'.

  • WW_FCAT-REPTEXT_DDIC = 'Profit Center'.

  • WW_FCAT-REF_FIELDNAME = 'prctr'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'MATNR'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Mat No'.

WW_FCAT-seltext_m = 'Material No'.

WW_FCAT-seltext_l = 'Material Number'.

WW_FCAT-EMPHASIZE = 'C200'.

  • WW_FCAT-REPTEXT_DDIC = 'Material Number'.

  • WW_FCAT-REF_FIELDNAME = 'matnr'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'ARKTX'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'SO Item Sh Text'.

WW_FCAT-seltext_m = 'SO Item Short Text'.

WW_FCAT-EMPHASIZE = 'C200'.

  • WW_FCAT-seltext_l = 'SO Item Short Text'.

WW_FCAT-OUTPUTLEN = '20'.

WW_FCAT-REPTEXT_DDIC = 'Short Txt For Sales ord Item'.

  • WW_FCAT-REF_FIELDNAME = 'arktx'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'KDMAT'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Customer Mat No'.

WW_FCAT-seltext_m = 'Customer Mat No'.

WW_FCAT-seltext_l = 'Customer Material No'.

WW_FCAT-EMPHASIZE = 'C200'.

    • WW_FCAT-REPTEXT_DDIC = 'Material No Used By Customer'.

WW_FCAT-OUTPUTLEN = '15'.

  • WW_FCAT-REF_FIELDNAME = 'kdmat'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'KWMENG'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Qty in Sales Units'.

WW_FCAT-seltext_m = 'Qty in Sales Units'.

WW_FCAT-seltext_l = 'Cumulative Qty in Sales Units'.

WW_FCAT-OUTPUTLEN = '10'.

WW_FCAT-EMPHASIZE = 'C600'.

  • WW_FCAT-REPTEXT_DDIC = 'Cumulative Ord Qty In Sales Units'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'NETWR'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Ord Value'.

WW_FCAT-seltext_m = 'Order Value'.

WW_FCAT-seltext_l = 'Total Order Value'.

  • WW_FCAT-EMPHASIZE = 'C200'.

WW_FCAT-EMPHASIZE = 'C500'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Order Value'.

WW_FCAT-OUTPUTLEN = '15'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'WAERK'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Currency'.

WW_FCAT-seltext_m = 'Ord Val Currency'.

WW_FCAT-seltext_l = 'Ord Val Currency'.

WW_FCAT-EMPHASIZE = 'C200'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Order Value Currency'.

WW_FCAT-OUTPUTLEN = '15'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'VBELNF'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Bill Doc No'.

WW_FCAT-seltext_m = 'Billing Doc No'.

WW_FCAT-seltext_l = 'Billing Document No'.

WW_FCAT-hotspot = 'X'.

  • WW_FCAT-REPTEXT_DDIC = 'Billing Document'.

WW_FCAT-EMPHASIZE = 'C300'.

WW_FCAT-OUTPUTLEN = '12'.

  • WW_FCAT-REF_FIELDNAME = 'vbeln'.

  • WW_FCAT-REF_TABNAME = 'VBFA'.

  • WW_FCAT-OUTPUTLEN = '50'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'FKART'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Bill Typ'.

WW_FCAT-seltext_m = 'Billing Type'.

WW_FCAT-seltext_l = 'Billing Type'.

WW_FCAT-OUTPUTLEN = '10'.

  • WW_FCAT-EMPHASIZE = 'C400'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Order Value Currency'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

WW_FCAT-REF_TABNAME = 'VBRK'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'VBTYP_N'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Doc Categ'.

WW_FCAT-seltext_m = 'Document Categ'.

WW_FCAT-seltext_l = 'Document Category'.

WW_FCAT-OUTPUTLEN = '10'.

  • WW_FCAT-EMPHASIZE = 'C400'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Order Value Currency'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

WW_FCAT-REF_TABNAME = 'VBFA'.

APPEND WW_FCAT TO IT_FIELDCAT.

  • CLEAR WW_FCAT.

  • colcnt = colcnt + 1.

  • WW_FCAT-COL_POS = colcnt.

  • WW_FCAT-FIELDNAME = 'POSNN'.

  • WW_FCAT-TABNAME = I_OUT.

  • WW_FCAT-REPTEXT_DDIC = 'Billing Item No'.

    • WW_FCAT-REF_FIELDNAME = 'posnn'.

  • WW_FCAT-REF_TABNAME = 'VBFA'.

  • WW_FCAT-OUTPUTLEN = 15.

  • APPEND WW_FCAT TO IT_FIELDCAT.

*

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'FKIMG'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Billed Qty'.

WW_FCAT-seltext_m = 'Actual Billed Qty'.

WW_FCAT-seltext_l = 'Actual Billed Qty'.

WW_FCAT-REPTEXT_DDIC = 'Actual Billed Qty'.

  • WW_FCAT-EMPHASIZE = 'C400'.

  • WW_FCAT-OUTPUTLEN = '20'.

  • WW_FCAT-REF_FIELDNAME = 'fkimg'.

WW_FCAT-REF_TABNAME = 'VBRP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'TOT_QTY'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'B.Q. For Item'.

WW_FCAT-seltext_m = 'B.Q. For Sales Item'.

WW_FCAT-seltext_l = 'Total B.Q. For Item'.

WW_FCAT-EMPHASIZE = 'C600'.

  • WW_FCAT-REPTEXT_DDIC = 'Actual Billed Qty'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'DIFF_QTY'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'B.Q. TO Be Billed'.

WW_FCAT-seltext_m = 'B.Q. TO Be Billed'.

WW_FCAT-seltext_l = 'B.Q. TO Be Billed'.

WW_FCAT-EMPHASIZE = 'C700'.

  • WW_FCAT-REPTEXT_DDIC = 'Actual Billed Qty'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'NETWR_B'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Total Bill Val'.

WW_FCAT-seltext_m = 'Total Bill Value'.

WW_FCAT-seltext_l = 'Total Bill Value'.

WW_FCAT-REPTEXT_DDIC = 'Total Bill Value'.

WW_FCAT-OUTPUTLEN = '12'.

  • WW_FCAT-EMPHASIZE = 'C400'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

  • WW_FCAT-REF_TABNAME = 'VBRK'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'TOT_BILL'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Sum for Item'.

WW_FCAT-seltext_m = 'Sum for Item'.

WW_FCAT-seltext_l = 'Sum for Sales Item'.

WW_FCAT-OUTPUTLEN = '12'.

WW_FCAT-EMPHASIZE = 'C500'.

  • WW_FCAT-EMPHASIZE = 'C411'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Bill Value for Sales Item'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

  • WW_FCAT-REF_TABNAME = 'VBRP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'DIFF'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'B.V. to be Billed'.

WW_FCAT-seltext_m = 'B.V. to be Billed'.

WW_FCAT-seltext_l = 'Total B.V. to be billed'.

WW_FCAT-OUTPUTLEN = '12'.

WW_FCAT-EMPHASIZE = 'C611'.

WW_FCAT-EMPHASIZE = 'C700'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Bill value to be billed'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

  • WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'AMT'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Amt Claimed'.

WW_FCAT-seltext_m = 'Total Amt Claimed'.

WW_FCAT-seltext_l = 'Total Amt Claimed'.

WW_FCAT-OUTPUTLEN = '12'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'TOT_AMT'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'Sum for AMT'.

WW_FCAT-seltext_m = 'Sum for AMT Claimed'.

WW_FCAT-seltext_l = 'Sum for AMT Claimed'.

WW_FCAT-OUTPUTLEN = '12'.

WW_FCAT-EMPHASIZE = 'C500'.

APPEND WW_FCAT TO IT_FIELDCAT.

CLEAR WW_FCAT.

colcnt = colcnt + 1.

WW_FCAT-COL_POS = colcnt.

WW_FCAT-FIELDNAME = 'DIFF_AMT'.

WW_FCAT-TABNAME = I_OUT.

WW_FCAT-seltext_s = 'AMT to be claimed'.

WW_FCAT-seltext_m = 'AMT to be claimed'.

WW_FCAT-seltext_l = 'AMT to be claimed'.

WW_FCAT-OUTPUTLEN = '12'.

WW_FCAT-EMPHASIZE = 'C611'.

WW_FCAT-EMPHASIZE = 'C700'.

  • WW_FCAT-REPTEXT_DDIC = 'Total Bill value to be billed'.

  • WW_FCAT-REF_FIELDNAME = 'kwmeng'.

  • WW_FCAT-REF_TABNAME = 'VBAP'.

APPEND WW_FCAT TO IT_FIELDCAT.

ENDFORM. " FIELD_CATALOG

&----


*& Form SORT_ORDER

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SORT_ORDER.

PERFORM SORT_ORDER_FILL USING: '01'

'VBELN'

'X'

''

' '.

PERFORM SORT_ORDER_FILL USING: '02'

'POSNR'

'X'

''

' '.

ENDFORM. " SORT_ORDER

&----


*& Form SORT_ORDER_FILL

&----


  • text

----


  • -->P_0898 text

  • -->P_0899 text

  • -->P_0900 text

  • -->P_0901 text

  • -->P_0902 text

----


FORM SORT_ORDER_FILL USING: P_SPOS TYPE SLIS_SPOS

P_FIELDNAME TYPE SLIS_FIELDNAME

P_UP TYPE SLIS_SOUP

P_DOWN TYPE SLIS_SODN

P_SUBTOT TYPE SLIS_DOSUB.

DATA: WA_SORT TYPE SLIS_SORTINFO_ALV.

WA_SORT-SPOS = P_SPOS.

WA_SORT-FIELDNAME = P_FIELDNAME.

WA_SORT-TABNAME = 'I_OUT'.

WA_SORT-UP = P_UP.

WA_SORT-DOWN = P_DOWN.

WA_SORT-SUBTOT = P_SUBTOT.

WA_SORT-GROUP = 'UL'.

WA_SORT-COMP = ' '.

WA_SORT-EXPA = ' '.

WA_SORT-OBLIGATORY = ' '.

APPEND WA_SORT TO IT_SORT.

ENDFORM. " SORT_ORDER_FILL

&----


*& Form GUI_STATUS

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GUI_STATUS.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = 25

TEXT = 'Fetching Data'.

ENDFORM. " GUI_STATUS

&----


*& Form DETAIL_SELECTION

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM DETAIL_SELECTION.

  • CLEAR I_OUT.

SELECT AVBELN APOSNR APS_PSP_PNR APRCTR AMATNR AMATNR

AARKTX AKDMAT AKWMENG ANETWR A~WAERK

BVBELN AS VBELNF BPOSNN B~VBTYP_N

APPENDING CORRESPONDING FIELDS OF TABLE I_OUT

FROM VBAP AS A

LEFT OUTER JOIN VBFA AS B

ON AVBELN = BVBELV AND

APOSNR = BPOSNV

WHERE A~VBELN IN S_VBELN AND

A~POSNR IN S_POSNR AND

A~PS_PSP_PNR IN S_WBS.

REFRESH S_VBELN.

REFRESH S_POSNR.

REFRESH S_WBS.

  • PERFORM SELECT_TYPE.

  • AND ( BVBTYP_N = 'M' OR BVBTYP_N = 'O' OR

  • B~VBTYP_N = 'P' )

ENDFORM. " DETAIL_SELECTION

&----


*& Form value_selection

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM value_selection.

clear t_vbrp.

SELECT VBELN AS VBELNF POSNR AS POSNN

Thankd in advance

0 Kudos

Hi,

Change the Following statement

select single vbeln into t_vbeln from vbap

where vbeln = s_vbeln-low. as

Select single vbeln into t_vbeln from vbap

where vbeln in s_vbeln.

I think , it will avoid the error.

Try it.

Regards,

Neptune.M

Plz Reward if it helps.

0 Kudos

Hi rashmi ,

program flow should be like this.

select-options: s_vbeln for vbrk-vbeln obligatory.

at selection-screen.

perform checks ( check the user inputs here and dont select any data from database tables to avoid performance issues)

.

like :

form

error.

endform

start-of-selection.

perform refresh.(refresh all internal tables , work areas)

perform get_data( get the data based oon the user inputs).

perform dis_data( here display the data ).

Regards

Prabhu

0 Kudos

select-options: s_vbeln for vbap-vbeln

<b>obligatory ( make there fields are required fields</b> ,

do the validation at a time for all inputs.

at selection-screen

perform checks.

code should be like this.

form.

if s_vbeln[] is initial.

error.

endform.

.

Start-of-selection

PERFORM REFRESH.(here refresh all enternal tables not select options ).

PERFORM EVENTTAB_BUILD USING I_EVENTS[].

PERFORM E04_COMMENT_BUILD USING

NG GT_LIST_TOP_OF_PAGE[].

PERFORM FIELD_CATALOG.

PERFORM SORT_ORDER.

PERFORM GUI_STATUS.

PERFORM BUILD_LAYOUT USING I_LAYOUT.

PERFORM DETAIL_SELECTION.

I_TEMP[] = I_OUT[].

DELETE I_OUT WHERE VBTYP_N <> 'M' AND

VBTYP_N <> 'O' AND

VBTYP_N <> 'P' AND

VBTYP_N <> 'N'.

Regards

Prabhu

0 Kudos

Hello Neptune

I tried it as per your suggestion,

but still problem is same,

selection-option for item is neither getting refreshed nor its values are getting transferred to program for first execution..

M not getting the reason for this..

Thanks

0 Kudos

Thanks Prabhu

but the problem is still thr

0 Kudos

Hi Rashmi ,

final step, please catch me on rao.peram@yahoo.com ( after 2.00pm).

Regards

prabhu

Former Member
0 Kudos

Hello Everybody

Problem is solved

very silly mistake..

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

  • Checking the correction of screen variable for Sales Document No

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

at selection-screen on s_vbeln.

if s_vbeln[] is initial.

message E001.

endif.

  • if s_vbeln-high eq '' .

  • message E001.

  • endif.

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

  • Checking the correction of screen variable for Item

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

*at selection-screen on s_posnr.

  • if s_posnr-low eq '' or s_posnr-high eq ''.

  • message E002.

  • endif.

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

  • Checking Document No Entered

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

if s_vbeln-low ne ''.

select single vbeln into t_vbeln from vbap

where vbeln = s_vbeln-low.

endif.

if sy-subrc ne 0.

message E003.

endif.

  • if s_vbeln-high ne ''.

  • select single vbeln into t_vbeln from vbap

  • where vbeln in s_vbeln.

  • endif.

  • if sy-subrc ne 0.

  • message E003.

  • endif.

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

  • Checking Sales Document Item No Entered

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

<b></b> at selection-screen on s_posnr.<b></b>

if s_posnr-low ne ''.

select single posnr into t_posnr from vbap

where posnr = s_posnr-low.

endif.

if sy-subrc ne 0.

message E004.

endif.

  • if s_posnr-high ne ''.

  • select single posnr into t_posnr from vbap

  • where posnr = s_posnr-high.

  • endif.

  • if sy-subrc ne 0.

  • message E004.

  • endif.

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

  • Start-of-selection

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

<b></b> START-OF-SELECTION.<b></b>

I have neither used at selection-screen on s_posnr nor

start-of-selection event

and thatz why values were not getting pass to program during 1st execution (cmplt program was in at selection-screen on s_vbeln event)

but when i was executing program second time , values were already passed to the program and thatz why filtering of records were taking place during 2nd execution of program

THanks again for all your responses