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: 

How to place cursor on any of this 5 fields and press button 'PICK HU'

Former Member
0 Kudos

Hi ,

i have designed a screen which displays 5 output fields .

i:e

1. 500002000189 " v_exidv1

2. 577823478388 " v_exidv2

3. 578278784278 " v_exidv3

4. 572389497892 " v_exidv4

5. 578727822764 " v_exidv5

i have taken these values in an internal table i_tab1 .

Below i have a button 'PICK HU'.

when i place cursor on any of this 5 fields and press button 'PICK HU'.

I must move to next screen where i am displaying data related to that field .

Please tell me how to catch this field and take it to next screen , when i place cursor on any1 of the above fields and click button 'PICK HU'.

Points will be awarded immediately .

Thanks ,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

first declare an internal table ...and retrive data from database to internal table .....

write the validations in PBO event .....display logic in pbo event itself........

after that, for u r push button in the layout write the display logic of u r related list in pai event ..........

reward points if helpful....

4 REPLIES 4

Former Member
0 Kudos

first declare an internal table ...and retrive data from database to internal table .....

write the validations in PBO event .....display logic in pbo event itself........

after that, for u r push button in the layout write the display logic of u r related list in pai event ..........

reward points if helpful....

Former Member
0 Kudos

hi,

jst try this incase of report...... n check out above incase of modulepool.......

TYPE-POOLS : VRM.

TYPES: BEGIN OF T_TAB,

VBELN TYPE VBAK-VBELN, " Sales and distribution document number

ERDAT TYPE VBAK-ERDAT, " Date on which the record was created

KUNNR TYPE VBAK-KUNNR, " Sold-to party 1

VDATU TYPE VBAK-VDATU, " Requested delivery date

END OF T_TAB.

TYPES: BEGIN OF T_TAB1,

VBELN TYPE VBAP-VBELN, " Sales and distribution

" document number

POSNR TYPE VBAP-POSNR, " Sales document item

MATNR TYPE VBAP-MATNR, " Material number

ARKTX TYPE VBAP-ARKTX, " Short text for sales order item

KWMENG TYPE VBAP-KWMENG, " Cumulative order quantity

" in sales units

END OF T_TAB1.

DATA : HEADER TYPE TABLE OF T_TAB WITH HEADER LINE,

ITEM TYPE TABLE OF T_TAB1 WITH HEADER LINE.

DATA : VRM TYPE VRM_VALUES,

WA LIKE LINE OF VRM.

data : begin of vbeln occurs 0,

vbeln type vbeln,

end of vbeln.

DATA : V_VBELN TYPE VBELN_VA,

V_FIELD(30),

V_VALUE(30).

*SELECT-OPTIONS : S_VBELN FOR V_VBELN AS LISTBOX VISIBLE LENGHT 10.

PARAMETERS : S_VBELN TYPE VBELN AS LISTBOX VISIBLE LENGTH 10.

at selection-screen OUTPUT.

select vbeln from vbak into table vbeln up to 10 rows.

DATA : V_NAME TYPE VRM_ID.

V_NAME = 'S_VBELN'.

LOOP AT VBELN.

WA-KEY = SY-TABIX.

WA-TEXT = VBELN-VBELN.

APPEND WA TO VRM.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = V_NAME

VALUES = VRM

EXCEPTIONS

ID_ILLEGAL_NAME = 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.

START-OF-SELECTION.

SET PF-STATUS 'TEST'.

SELECT VBELN ERDAT KUNNR VDATU FROM VBAK INTO TABLE HEADER

WHERE VBELN = S_VBELN.

IF SY-SUBRC = 0.

SELECT VBELN POSNR MATNR ARKTX KWMENG FROM VBAP

INTO TABLE ITEM

FOR ALL ENTRIES IN HEADER

WHERE VBELN = HEADER-VBELN.

write : (1) sy-vline,

(20) 'VBELN' HOTSPOT ON,

(21) SY-VLINE,

(42) 'KUNNR',

(43) SY-VLINE.

loop at header.

hide : header-vbeln,header-kunnr.

write: /(1) sy-vline,

(20) HEADER-VBELN,

(21) SY-VLINE,

(42) HEADER-KUNNR,

(43) SY-VLINE.

endloop.

ENDIF.

AT LINE-SELECTION.

SET PF-STATUS 'TEST'.

GET CURSOR FIELD V_FIELD VALUE V_VALUE.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = V_VALUE

IMPORTING

OUTPUT = V_VALUE

.

LOOP AT ITEM WHERE VBELN = V_VALUE.

WRITE : / ITEM-VBELN, ITEM-POSNR, ITEM-POSNR.

ENDLOOP.

WRITE : / SY-LSIND hotspot on,

header-vbeln.

DATA : V_LSIND TYPE SY-LSIND.

V_LSIND = SY-LSIND.

IF V_LSIND = 20.

SY-LSIND = 0.

ENDIF.

reward points if helpful........

Former Member
0 Kudos

Hi again,

I think you should check out the help on "get cursor field xxxxx" because it will allow you to pick up the name of the field your cursor was on, and then you can invoke the next screen for the appropriate "EXIDVn" value.

Jonathan

Former Member
0 Kudos

Hi,

<b>

PROCESS AFTER INPUT.</b>

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'

LOOP AT itab.

CHAIN.

FIELD itab-xblnr.

FIELD itab-bldat.

FIELD itab-rmwwr.

field itab-cputm.

ENDCHAIN.

FIELD itab-mark

MODULE tab1_mark ON REQUEST.

<b>module itab_modify.</b>

ENDLOOP.

*&SPWIZARD: MODULE TAB1_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TAB1_CHANGE_COL_ATTR.

MODULE user_command_1000.

this is my first screen.

in itab_modify write,

<b>module itab_modify input.</b>

GET CURSOR FIELD xblnr VALUE bill_no.

endmodule. " itab_modify INPUT

here i want to display data according to xblnr in first screen.

declare

DATA : bill_no like rbkp-xblnr,

xblnr like rbkp-xblnr.

in TOP module.

now in user command of first screen give FCODE of that push button in case.

<b>

MODULE user_command_1000 INPUT.</b>

CASE ok_code.

WHEN 'BACK' OR 'UP' OR 'CANC'.

LEAVE PROGRAM.

WHEN 'SV'.

<b> when 'INFO'.</b>

call screen 1001.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

and in 1001 screen make one module fetch_data1 in PBO.

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TAB2'

<b>module fetch_data1.</b>

MODULE TAB2_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TAB2_CHANGE_COL_ATTR.

LOOP AT ITAB2

INTO ITAB2

WITH CONTROL TAB2

CURSOR TAB2-CURRENT_LINE.

*&SPWIZARD: MODULE TAB2_CHANGE_FIELD_ATTR

ENDLOOP.

and write

<b>

module fetch_data1 output.</b>

SELECT SINGLE xblnr bldat rmwwr cputm FROM rbkp INTO

corresponding fields of itab2

WHERE xblnr = bill_no.

  • MODIFY itab FROM itab INDEX tab1-current_line.

APPEND itab2.

endmodule. " fetch_data1 OUTPUT

hope it will helpful to u.