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

Query on dialog programming..

Former Member
0 Likes
1,296

Hi All,

I have two fields in the screen.

For example : Field-1 : Material number (user can enter value)

Field-2 : Material Description (user cant enter value.. Output Only)

Whenever there is a change in the Field-1, corresponding Field-2 value should be display.

I don't have any other controls in the screen like buttons.

I know that, if there is a button in the screen then when the user press the button i can write the corresponding code there. But without any other control like... whenever there is a change in the field, the other field value should change.

How to achieve it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,211

Hi again,

To try it without pressing the enter key, use the following function module

DYNP_VALUES_UPDATE

and to get values from your screen, use the following function module

DYNP_VALUES_READ

Hope it works.

Regards,

Ibrar

11 REPLIES 11
Read only

Former Member
0 Likes
1,211

Hi Raghu Raman,

You cant trigger PAI with out any action, atleast use F4 option on Material Number or ENTER Button.

Regards,

Mr A

Read only

0 Likes
1,211

Hi,

I used F4 option for the first field, inside that i writing the logic for populating the value for second field.

The value is assigned to the screen field( declared as global variable ), but it not assigning to the screen field when the screen displayed.

But once I select the value from F4 help and press enter then the value getting populated.

Is there any way without pressing the enter, the value getting displayed?

Regards,

Raghu

Read only

0 Likes
1,211

Hi Raghu,

I decalred Matnr & Maktx from MAKT Table in a Screen 100..


REPORT  ZSAMPLE_12  .

TABLES :MAKT.
CALL SCREEN 100.

*&---------------------------------*
*&      Module  STATUS_0100  OUTPUT
*-----------------------------------*
MODULE STATUS_0100 OUTPUT.
  SELECT SINGLE * FROM MAKT WHERE MATNR EQ MAKT-MATNR.
ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*-----------------------------------*
MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN OTHERS.
      SELECT SINGLE * FROM MAKT WHERE MATNR EQ MAKT-MATNR.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

Thanks & regards,

Dileep .C

Read only

0 Likes
1,211

dileep ,

I don't think this is the requirement ,

actually he just wants tht as soon as he enters the material number the corresponding material description should be populated in the maktx field.

i think he need to create a module in PAI for populating the material description keeping a check on the ,

material enetered and also set the field only for output .

Regards,

Rajesh Kumar ,

Read only

0 Likes
1,211

Hi Rajesh,

dileep ,

I don't think this is the requirement ,

Yes I know this is not requirement.

actually he just wants tht as soon as he enters the material number the corresponding material description should be populated in the maktx field.

i think he need to create a module in PAI for populating the material description keeping a check on the ,

material enetered and also set the field only for output .

Its like a Auto refresh or like webpage to validate background. -

-


And this is possible only if he selects through f4, Dropdown or any other sources. but not by entering material no.

Since when he enters material no. he need to finish entering No... how does system know whether he entered a no. or not,,, he need to press anything(any event need to be triggered.)

As per My knowledge The Answer is in first two replies for the requirement,,.

& in further replies Raghu already written he doesnt even want to press Enter,,,

No I am just waiting & Watching for some experts solutions....

Thanks & regards,

Dileep .C

Read only

Former Member
0 Likes
1,211

hi Raghu,

As per my Knowledge, ABAP is event driven language and i think without pressing enter or any button , we can't populate the fileld-2 description.

Read only

Former Member
0 Likes
1,211

Hi Raghu,

Create a module in PAI with the following code

MODULE get_maktx INPUT.

IF p9703-matnr NE ' '.

SELECT SINGLE * FROM makt

WHERE matnr = p9703-matnr

AND spras = 'EN'.

IF sy-subrc = 0.

MOVE:makt-maktx TO p9703-maktx.

ELSE.

CLEAR p9703-maktx.

ENDIF.

ENDIF.

EndModule.

Hope it works.

Regards,

Ibrar

Read only

Former Member
0 Likes
1,211

in PAI of the screen write like

Field matnr module get_matxt on request.

now double click on get_matxt.

Module get_matxt .

now here you can get your materail description with help of select query.

endmodule.

This module is called when you enter new value to material field.

Regards,

Alpesh

Read only

Former Member
0 Likes
1,212

Hi again,

To try it without pressing the enter key, use the following function module

DYNP_VALUES_UPDATE

and to get values from your screen, use the following function module

DYNP_VALUES_READ

Hope it works.

Regards,

Ibrar

Read only

Former Member
0 Likes
1,211

hI!

If you want to proceed in this way it would be better if you make your material number as a list box and on selecting a value in listbox you can get the material description populated.

This would be a better approach for it....

the demo examples explain it...

DEMO_DYNPRO_DROPDOWN_LISTBOX

DEMO_DROPDOWN_LIST_BOX

or you can proceed as this wat....

in the top include...


tables makt.
types :
  begin of material,
   matnr type makt-matnr,
   maktx type makt-maktx ,
  end of material.

data
  : fs_material type material.

data :
 t_material like
            standard
            table of fs_material.

data
  ok_code type sy-ucomm.

in the main program...



include yh1316_input_values_top                 .    " global Data

* INCLUDE YH1316_INPUT_VALUES_O01                 .  " PBO-Modules
* INCLUDE YH1316_INPUT_VALUES_I01                 .  " PAI-Modules
* INCLUDE YH1316_INPUT_VALUES_F01                 .  " FORM-Routines

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
  set pf-status 'STATUS'.
endmodule.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  FILL_DESCRIPTION  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module fill_description input.
move makt-matnr to fs_material-matnr.
if fs_material-matnr ne ' '.
select matnr maktx  from makt
into table t_material
where matnr = fs_material-matnr
and spras = 'EN'.
if sy-subrc = 0.
loop at t_material into fs_material.
move:fs_material-maktx to fs_material-maktx.
endloop.
else.
clear fs_material-maktx.
endif.
endif.

endmodule.                 " FILL_DESCRIPTION  INPUT

in the layout table the matnr as dictionary from makt(MAKT_MAKTX)

and description as from program (FS_MATERIAL-MAKTX)

this works the same as you want on entering the material press enter in hits pai and the module fill_description is executed.

Regards.

Edited by: Richa Tripathi on Jun 11, 2009 7:33 AM

Edited by: Richa Tripathi on Jun 11, 2009 7:39 AM

Read only

Former Member
0 Likes
1,211

Hi Raghu,

Check this link...

[]

Regards,

Satish Reddy.