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 exit

Former Member
0 Likes
457

Hi,

I have two fields in the UI screen..Plant and Work Center.

Based on whatever the user enters in the Plant field, the search help for work center should come up. i.e, if the user enters the Plant as 0001, the search help for work center should show up the work center values only for Plant 0001.

Dialog box restriction wont help because the user needs to enter the plant again.

Do I need to write a search help exit for this?

Could you send me some sample code for search help exits?

Regards,

Srilakshmi B

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
428

Use the FM : CR_WORKSTATION_READ_ROUTING

* Validate Work Centre
  if not ZES_PO_ITEM-ST_ARBPL is initial.
    clear : T399X.
    select single * from T399X where WERKS = ZES_PO_ITEM-ST_SWERK
                                 and AUART = ZES_PO_ITEM-ST_AUART.

    if SY-SUBRC = 0.

      call function 'CR_WORKSTATION_READ_ROUTING'
        exporting
          ARBPL = ZES_PO_ITEM-ST_ARBPL
          DATE  = SY-DATUM
          PLNTY = T399X-PLNTY
          WERKS = ZES_PO_ITEM-ST_SWERK."L_SWERK.

      if SY-SUBRC <> 0.
        message E138(ZSM) with 'Work Centre not maintained for plant' ZES_PO_ITEM-ST_IWERK.
      endif.
    endif.
  endif.

Regards

Gopi

Use the FM : CR_WORKSTATION_READ_ROUTING

* Validate Work Centre
  if not ZES_PO_ITEM-ST_ARBPL is initial.
    clear : T399X.
    select single * from T399X where WERKS = ZES_PO_ITEM-ST_SWERK
                                 and AUART = ZES_PO_ITEM-ST_AUART.

    if SY-SUBRC = 0.

      call function 'CR_WORKSTATION_READ_ROUTING'
        exporting
          ARBPL = ZES_PO_ITEM-ST_ARBPL
          DATE  = SY-DATUM
          PLNTY = T399X-PLNTY
          WERKS = ZES_PO_ITEM-ST_SWERK."L_SWERK.

      if SY-SUBRC <> 0.
        message E138(ZSM) with 'Work Centre not maintained for plant' ZES_PO_ITEM-ST_IWERK.
      endif.
    endif.
  endif.

Regards

Gopi

2 REPLIES 2
Read only

gopi_narendra
Active Contributor
0 Likes
429

Use the FM : CR_WORKSTATION_READ_ROUTING

* Validate Work Centre
  if not ZES_PO_ITEM-ST_ARBPL is initial.
    clear : T399X.
    select single * from T399X where WERKS = ZES_PO_ITEM-ST_SWERK
                                 and AUART = ZES_PO_ITEM-ST_AUART.

    if SY-SUBRC = 0.

      call function 'CR_WORKSTATION_READ_ROUTING'
        exporting
          ARBPL = ZES_PO_ITEM-ST_ARBPL
          DATE  = SY-DATUM
          PLNTY = T399X-PLNTY
          WERKS = ZES_PO_ITEM-ST_SWERK."L_SWERK.

      if SY-SUBRC <> 0.
        message E138(ZSM) with 'Work Centre not maintained for plant' ZES_PO_ITEM-ST_IWERK.
      endif.
    endif.
  endif.

Regards

Gopi