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

Search Help

Former Member
0 Likes
713

Hi ,

Can anyone please help in populating data to different Screen field also . My scenario is when F4 is pressed on Sales order field in a Transaction data should also populate in POSNR as well which is below VBELN . I'm able to pull data but not able to put in POSNR screen field.

Thanks ,

anjani.

6 REPLIES 6
Read only

Former Member
0 Likes
605

Hi

You should manage it in the POV (Process On Value-Request for module pool or AT SELECTION-SCREEN On VALUE-REQUEST for report). In this event you call search help, after choosing the order you can do a select on VBAP to find out the posnr, so use the fm DYNP_VALUES_UPDATE to update the field POSNR.

Max

Read only

suresh_datti
Active Contributor
0 Likes
605

Hi Anjani,

Is this a custom Transaction?

Regards,

Suresh Datti

Read only

0 Likes
605

Hi Max,

DYNP_UPDATE_FIELDS Function Module is populating values into Screen Fields but the popup of search help is not coming. can you tell me What to do ?

Thanks,

anjani

Read only

0 Likes
605

Hi

Use the fm F4IF_FIELD_VALUE_REQUEST:

DATA: RETURN_TAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE,

DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = SPACE

FIELDNAME = SPACE

SEARCHHELP = 'VMVA'

  • dynpprog = sy-repid

  • dynpnr = sy-dynnr

  • dynprofield =

  • display = space

TABLES

RETURN_TAB = RETURN_TAB.

  • Get the value choosen:

READ TABLE RETURN_TAB INDEX 1.

  • Transfer the value to input/output field

MOVE RETURN_TAB-FIELDVAL TO VBAK-VBELN.

  • Find out the posnr:

SELECT * FROM VBAP WHERE VBELN = VBAK-VBELN.

DYNPFIELDS-FIELDNAME = 'VBAP-POSNR'.

DYNPFIELDS-FIELDVALUE = VBAP-POSNR.

  • If you have a table control, fill this field too.

index = index + 1.

DYNPFIELDS-STEPL = INDEX.

APPEND DYNPFIELDS.

ENDSELECT.

  • here call DYNP_UPDATE_FIELDS

Max

Message was edited by: max bianchi

Read only

0 Likes
605

Hi Max ,

I'm calling the DYNP_UPDATE_FIELDS in Search help Exit . This exit is created in Elementary search help which i attached to VMVA Standard Search help.

Thanks,

anjani.

Read only

0 Likes
605

Hi

I think you can't manage it in exit of search help, but you should do it in the program where your search help is called.

For example: SCREEN 100 have two fields: VBAK-VBELN and VBAK-POSNR:

PROCESS PBO.

MODULE ......

PROCESS PAI.

MODULE ....

PROCESS ON-VALUE REQUEST.

FIELD VBAK-VBELN MODULE F4_FOR_VBELN.

MODULE F4_FOR_VBELN.

DATA: RETURN_TAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = SPACE

FIELDNAME = SPACE

SEARCHHELP = 'VMVA'

  • dynpprog = sy-repid

  • dynpnr = sy-dynnr

  • dynprofield = ' '

  • display = space

TABLES

RETURN_TAB = RETURN_TAB.

READ TABLE RETURN_TAB WITH KEY FIELDNAME = 'VBELN'.

CHECK SY-SUBRC = 0.

MOVE RETURN_TAB-FIELDVAL TO VBAK-VBELN.

DATA: BEGIN OF DYNPFIELDS OCCURS 0.

INCLUDE STRUCTURE DYNPREAD.

DATA: END OF DYNPFIELDS.

MOVE SY-CPROG TO PROGNAME.

SELECT * FROM VBAP WHERE VBELN = VBAK-VBELN.

DYNPFIELDS-FIELDNAME = 'VBAP-POSNR'.

DYNPFIELDS-FIELDVALUE = VBAP-POSNR.

APPEND DYNPFIELDS.

EXIT.

ENDSELECT.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = PROGNAME

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYNPFIELDS.

ENDMODULE.

Max

Message was edited by: max bianchi

Message was edited by: max bianchi