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: 

Purchase Order Enhancement ME23N display mode, fields editable

Former Member

so, i'v implemented the ME_PROCESS_PO_CUST, but am having issues controlling the edit / change mode of my fields.

I think I'm setting the field status appropriate, but my fields are always coming in change mode.

 

 l_changeable = im_header->is_changeable( ).

  LOOP AT ch_fieldselection ASSIGNING <fs>.
    IF <fs>-metafield BETWEEN 90000000 AND 91000012.
      IF l_changeable IS INITIAL.
        <fs>-fieldstatus = '*'. " Display
      ELSE.
        <fs>-fieldstatus = '+'. " Change
      ENDIF.
    ENDIF.
  ENDLOOP.

Should I have some sort of setting in my screen layout on those fields/

Edited by: Robert Phelan on Mar 6, 2012 4:41 AM

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos

Hi Robert,

are you sure, that l_changeable is INITIAL in display mode? Or could it have some content like 'N'?

Regards,

Klaus

7 REPLIES 7

former_member195402
Active Contributor
0 Kudos

Hi Robert,

are you sure, that l_changeable is INITIAL in display mode? Or could it have some content like 'N'?

Regards,

Klaus

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

I use this coding in IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER for a header field



  l_changeable = im_header->is_changeable( ).

* ...........

  READ TABLE ch_fieldselection ASSIGNING <fs>
      WITH TABLE KEY metafield = mmmfd_cust_01.
*.....
      IF l_changeable = 'X'.
        <fs>-fieldstatus = '.'. " READY FOR INPUT
      ELSE.
        <fs>-fieldstatus = '*'. " view
      ENDIF.
*.......

where types MMMFD


*- customer fields
mmmfd_cust_01          TYPE mmpur_metafield VALUE 90000000,
mmmfd_cust_02          TYPE mmpur_metafield VALUE 90000001,
mmmfd_cust_03          TYPE mmpur_metafield VALUE 90000002,
mmmfd_cust_04          TYPE mmpur_metafield VALUE 90000003,
mmmfd_cust_05          TYPE mmpur_metafield VALUE 90000004,
mmmfd_cust_06          TYPE mmpur_metafield VALUE 90000005,
mmmfd_cust_07          TYPE mmpur_metafield VALUE 90000006,
mmmfd_cust_08          TYPE mmpur_metafield VALUE 90000007,
mmmfd_cust_09          TYPE mmpur_metafield VALUE 90000008,
mmmfd_cust_10          TYPE mmpur_metafield VALUE 90000009.

Don't forgot set this fields in ME_GUI_PO_CUST, for instance, in IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS


METHOD if_ex_me_gui_po_cust~map_dynpro_fields.

  FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.

  LOOP AT ch_mapping ASSIGNING <mapping>.

    CASE <mapping>-fieldname.

      WHEN 'ZZFIELD'.

        <mapping>-metafield            = mmmfd_cust_01.

    ENDCASE.

  ENDLOOP.

ENDMETHOD.

I hope this helps you

Regards

Eduardo

0 Kudos

In METHOD if_ex_me_process_po_cust~fieldselection_header, I've changed my code to


* Is PO changeable?
  l_changeable = im_header->is_changeable( ).

  LOOP AT ch_fieldselection ASSIGNING <fs>.
    IF <fs>-metafield BETWEEN 90000000 AND 91000012.
      IF l_changeable = 'X'.

        <fs>-fieldstatus = '.'. " Change
      ELSE.
        <fs>-fieldstatus = '*'. " Display
      ENDIF.
    ENDIF.
  ENDLOOP.

In IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS, I already have:


  TYPE-POOLS: mmmfd.

  FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.

  LOOP AT ch_mapping ASSIGNING <mapping>.

    CASE <mapping>-fieldname.

      WHEN 'ZZSHIFT'.
        <mapping>-metafield = 91000000.
      WHEN 'ZZDROP'.
        <mapping>-metafield = 91000001.
      WHEN 'ZZVEH_DEPOT_CODE'.
        <mapping>-metafield = 91000002.
      WHEN 'ZZDRIVER'.
        <mapping>-metafield = 91000003.
      WHEN 'ZZTRUCK'.
        <mapping>-metafield = 91000004.
      WHEN 'ZZTRIP'.
        <mapping>-metafield = 91000005.
      WHEN 'ZZTRIP_DISTANCE'.
        <mapping>-metafield = 91000006.
      WHEN 'ZZTRIP_TIME'.
        <mapping>-metafield = 91000007.
      WHEN 'ZZETA'.
        <mapping>-metafield = 91000008.
      WHEN 'ZZSCULLY_IND'.
        <mapping>-metafield = 91000009.
      WHEN 'ZZSLS_PRODUCT'.
        <mapping>-metafield = 91000010.
      WHEN 'ZZAM_OPEN'.
        <mapping>-metafield = 91000011.
      WHEN 'ZZPM_CLOSE'.
        <mapping>-metafield = 91000012.
    ENDCASE.


  ENDLOOP.

Running ME23N:

L_CHANGEABLE is INITIAL and the result of my table is


METAFIELD   FIELDSTATUS
91000000	*
91000001	*
91000002	*
91000003	*
91000004	*
91000005	*
91000006	*
91000007	*
91000008	*
91000009	*
91000010	*
91000011	*

So, they should all be in DISPLAY mode, but come in change mode.

Running ME22N:

L_CHANGEABLE = 'X' and the result of my table is


METAFIELD   FIELDSTATUS
91000000	.
91000001	.
91000002	.
91000003	.
91000004	.
91000005	.
91000006	.
91000007	.
91000008	.
91000009	.
91000010	.
91000011	.
91000012	.

And the fields DO come in Change mode properly.

Is there something in screen painter that i'm missing?

Edited by: Robert Phelan on Mar 6, 2012 3:24 PM

0 Kudos

I see the problem and it was indeed in screen painter.

I had named my fields EKKO-ZZPM_CLOSE etc.. instead of CI_EKKODB-ZZPM_CLOSE - i didn't use the customer include structure.

As soon as I changed that, it worked.

thanks alot for the help.

Robert.

0 Kudos

Hi Robert,

In In IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS try this (I think that here maybe is your trouble):



FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
 
  LOOP AT ch_mapping ASSIGNING <mapping>.
 
    CASE <mapping>-fieldname.
 
      WHEN 'ZZSHIFT'.
        <mapping>-metafield = mmmfd_cust_01.
      WHEN 'ZZDROP'.
        <mapping>-metafield = mmmfd_cust_02.
      WHEN 'ZZVEH_DEPOT_CODE'.
        <mapping>-metafield = mmmfd_cust_03.
      WHEN 'ZZDRIVER'.
        <mapping>-metafield = mmmfd_cust_04.
      WHEN 'ZZTRUCK'.
        <mapping>-metafield = mmmfd_cust_05.
      WHEN 'ZZTRIP'.
        <mapping>-metafield = mmmfd_cust_06.
      WHEN 'ZZTRIP_DISTANCE'.
        <mapping>-metafield = mmmfd_cust_07.
      WHEN 'ZZTRIP_TIME'.
        <mapping>-metafield = mmmfd_cust_08.
      WHEN 'ZZETA'.
        <mapping>-metafield = mmmfd_cust_09.
      WHEN 'ZZSCULLY_IND'.
        <mapping>-metafield = mmmfd_cust_10.
*     WHEN 'ZZSLS_PRODUCT'.
*      <mapping>-metafield = 91000010.
*      WHEN 'ZZAM_OPEN'.
*        <mapping>-metafield = 91000011.
*      WHEN 'ZZPM_CLOSE'.
*        <mapping>-metafield = 91000012.  "I don't have more constants for customer fields
    ENDCASE.
 
 
  ENDLOOP.

Don't declare the type pools.

I believe that you have more fields that you can add, but I'm not sure, because I don't know what is your release. Reading your coding I believe that this data is related with transport or trucks. Have you though about the possibility to use new partners in the PO for this requirement and save some fields? Talk with an MM consultant, perhaps you find an easier solution, or use inbound deliveries and set this inbound deliveries to a transport document.

It's an idea.

I hope this helps you

Regards

Eduardo

0 Kudos

I had already tried using the standard mmmfd_cust* fields.. but as I needed more than were provided, I had to use my own range.

I was worried, too, that it was a hard limitation, but it worked - I wanted to post that here, as well, so others can benefit from that experience.

This is more delivery information tied to a PO - we bought some assets in the UK and we are having to replicate their functionality as close as possible.

0 Kudos

Hi Robert,

Perhaps we forgot some inputs. See the sample coding for ME_GUI_PO_CUST. You need to use the methods TRANSPORT_FROM_MODEL, TRANSPORT_TO_DYNP, TRANSPORT_FROM_DYNP, TRANSPORT_TO_MODEL, EXECUTE.

I suggest you to follow this coding and set break-points in all methods and have tons of patience. I remember as a nightmare any time that I have developed it. Think that you are putting your coding in PAI and PBO.

Finally, see SAP Note 496083 - FAQ: Customer enhancements (User Exits) in purchasing, last question when it says:



Question:
I implemented the 'ME_GUI_PO_CUST' Business Add-In to display customerspecific
tab titles in the EnjoySAP purchase order. They are only shown in
display mode (ME23N) however, not in create or change. Why?

Solution:
You may have forgotten to assign a field status to the user-defined fields
on these tabs. As a result, the system automatically interprets the field
status as 'hidden' in create and change modes. However if a tab contains
only hidden fields, then the entire tab is set to hidden. In display mode,
fields without a field status are automatically set to display. That is why
the tab is displayed in this case.
To assign a field status to the user-defined fields, use the methods
provided for this purpose in the Business Add-In 'ME_PROCESS_PO_CUST'
(compare sample source code in the FIELDSELECTION_ITEM method).

I hope this helps you

Regards

Eduardo