cancel
Showing results for 
Search instead for 
Did you mean: 

quantity field as input field in purchase templates

matthias_kasig2
Participant
0 Kudos

Hi SDN,

we are on WAS 700, SRM 5.0. SRM Server 5.5

I am facing an urgent change request, which is a modification of standard templates and dynpros.

The Task:

When I create a shopping cart via "Old Purchase Orders and Templates" I want the quantity field as an input field, so that I can change quantities right here, when adding items from the public template to the shopping cart.

The Business Case:

We get tons of bad user feedback, as the process as it is, is really time consuming, because first you chose items from the template and in the next step you have to change the quantities.

The html template involved is the:

SAPLBBP_PDH_SEARCH 4001

The corresponding dynpro is:

4001 in function group BBP_PDH_SEARCH

In the dynpro I see a quantity-field in the creen painter:

-QUANTITY in Table Control TC_SUBLIST_SC

in the html template I have:

`if (SUBLIST-ITM_TYPE[n].value != "HIER")`
              `SUBLIST-QUANTITY[n].value` `SUBLIST-UNIT[n].value`

I guess I need something like:

<input type="text" name="<SUB_WA>-QUANTITY" value="`SUBLIST-QUANTITY[n].value`">

How do I set up the input field? Help greatly appreciated!!!

Kind regards, Matthias Kasig

Message was edited by:

Matthias Kasig

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matthias,

First step is to enable this field for editing in dynpro. Enable quantity field for editing and test the solution. If work, go to html template and add this line:

<input type="text" name="NAME_OF_FIELD" value="`SUBLIST-QUANTITY[n].value`">

NAME_OF_FIELD = quantity field name in table control (TC_SUBLIST_SC)

This is not <SUB_WA>-QUANTITY because <SUB_WA> is field-symbol.

Regards,

Marcin

matthias_kasig2
Participant
0 Kudos

Hi Marcin and Disha,

thanx for the answers.

to Marcin: I enabled the dynpro field for editing already. You are right. The point is, which name must I give to the html input field?

Just for a test I put an char quantity zfield on the dynpro 4001 - in fact I can build an html inputfield for that and in the debugger I see in PAI, that a changed value is passed on.

If I could add such an own z-field to this tablecontrol, that would also be fine. Right now I am thinking of an internal ztable which should be filled with data from <sublist>. But I assume I can't add something like my_table-quantity to the tablecontrol (I tried that already, values from corresponding html input don't get passed on) - But I can add a structure field to the TC, eg my_structure-quantity. then the corresponding value from the html gets passed on to PAI. But I need some sort of table here...

something like `SUBLIST-QUANTITY[n].value = my_structure-quantity` on the html siede does not work either. I assume, I would need an extra submit for that.

to Disha: Yes, I tried the BADI - I put an external breakpoint in there, without effect.

I implemented method BBP_SC_UI_CTRL

kind regards, matthias

Former Member
0 Kudos

Hi,

Try ty add something like this:

<input type="text" name="SUBLIST-QUANTITY[`n`]" VALUE="`SUBLIST-QUANTITY[n].value`" size="10">

Regards,

Marcin Gajewski

matthias_kasig2
Participant
0 Kudos

Hi Marcin,

it does not work - tried that already...

matthias

matthias_kasig2
Participant
0 Kudos

Hi Marcin,

good idea, though - in the html source code I get this:

<input type="text" name="SUBLIST-QUANTITY[2]" VALUE="                                     40" size="10">

but when I change the value from 40 to eg 12 this does not show up in PAI of the dynpro 4001...

matthias

Former Member
0 Kudos

Maybe in PAI quantity field is not transferred?

look in module "mark_read_from_web" in PAI to read this field.

Regards,

Marcin

matthias_kasig2
Participant
0 Kudos

Hi marcin,

in PAI in "mark_read_from_web" I see, that <sublist> contains the old values and not the "new" ones from the html input field. The value is not transferred.

matthias

Former Member
0 Kudos

Hi,

in perform mark_read_from_web you have something like that:

MODIFY <sublist> FROM <lfs_sub_wa>.

this modifies your sublist with new values.

All you have to do is add to <lfs_sub_wa> quantity field.

in code:

lv_index = lv_index + 1.
      field-get 'SUBLIST-MARK' lv_index lt_mark lv_leng.
      IF sy-subrc <> 0.
        CONTINUE.
      ELSE.
        READ TABLE lt_mark INDEX 1.
        IF sy-subrc EQ 0.
          MOVE lt_mark TO <lfs_sub_mark>.
          MODIFY <sublist> FROM <lfs_sub_wa>.

          IF <lfs_itm_type> EQ c_hier AND
             <lfs_exp> is initial And
             lt_mark EQ gc_yes.
            MOVE <lfs_itm_guid> TO lt_sel_hier-guid.
            APPEND lt_sel_hier.
          ENDIF.
        ENDIF.
      ENDIF.

add something like this:

lv_index = lv_index + 1.
      field-get 'SUBLIST-MARK' lv_index lt_mark lv_leng.
      field-get 'SUBLIST-QUANTITY' lv_index lt_mark lv_leng.
      IF sy-subrc <> 0.
        CONTINUE.
      ELSE.
        READ TABLE lt_mark INDEX 1.
        IF sy-subrc EQ 0.
          MOVE lt_mark TO <lfs_sub_mark>.
          MODIFY <sublist> FROM <lfs_sub_wa>.

          IF <lfs_itm_type> EQ c_hier AND
             <lfs_exp> is initial And
             lt_mark EQ gc_yes.
            MOVE <lfs_itm_guid> TO lt_sel_hier-guid.
            APPEND lt_sel_hier.
          ENDIF.
        ENDIF.
      ENDIF.

Regards,

Marcin Gajewski

matthias_kasig2
Participant
0 Kudos

Hi Marcin,

I tried, what you said - but it has no effect.

on the html side I have:

<input type="text" name="SUBLIST-QUANTITY[`n`]" VALUE="`SUBLIST-QUANTITY[n].value`" size="10">

and in the dynpro I added:

field-get 'SUBLIST-QUANTITY' lv_index lt_mark lv_leng.

I don't know how field-get works, but it seems that still my old value gets transferred (which is saved with the shopping cart public template)

This way, I get no access to the new value from the html input field.

During the loop:

LOOP AT <sublist> INTO <lfs_sub_wa>.

there is still the old value in the quantity field and field-get does not bring up the new value either.

Matthias

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Did you try using the BADI <b>BBP_UI_CONTROL_BADI</b> to make the quantity field editable instead of modifying the Std ITS template?

BR,

Disha.

Pls reward points for useful answers.