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

Copy Reference Option Need Idea in Module pool

kabil_g
Active Participant
0 Likes
4,528

Hi Frds,

I have developed custom material master screen using Module pool

I that my customer is asking to Copy with reference of which early created material number...... Pls guide me how to create the copy option in these requirement..........

Regards,

Kabil

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
4,473

Hi kabil,

Like standard Program you can create two inputs

eg: first       field matnr1,

     Second  field matnr2.

Add the Search help for both inputs in Module pool.

use CHAIN Statement.

Abap Editor.

if matnr2 is not initial.

get the related values for that material pass the values to the corresponding screen values

then call the  another screen.

else.

call the another  screen.

endif.

Regards,

Venkat.

Hi Frds,

I have developed custom material master screen using Module pool

I that my customer is asking to Copy with reference of which early created material number...... Pls guide me how to create the copy option in these requirement..........

Regards,

Kabil

26 REPLIES 26
Read only

Former Member
0 Likes
4,473

This message was moderated.

Read only

VenkatRamesh_V
Active Contributor
0 Likes
4,474

Hi kabil,

Like standard Program you can create two inputs

eg: first       field matnr1,

     Second  field matnr2.

Add the Search help for both inputs in Module pool.

use CHAIN Statement.

Abap Editor.

if matnr2 is not initial.

get the related values for that material pass the values to the corresponding screen values

then call the  another screen.

else.

call the another  screen.

endif.

Regards,

Venkat.

Read only

0 Likes
4,473

Hi Venkatesh,

Sorry for late reply . Can you elaborate these pls

Read only

0 Likes
4,473

I have made the changes as per said its not changing material number while saving its going to previous material number only

Read only

kabil_g
Active Participant
0 Likes
4,473

I have developed custom material master screen using Module pool

I that my customer is asking to Copy with reference of which early created material number...... Pls guide me how to create the copy option in these requirement......

Read only

0 Likes
4,473

Hi kabil,

Hope I understand your requirement, if i am wrong reply me,

while creating new Material every field will be blank, user entering the fields,

create another input as copy with reference,  if the user enter the input,

get the relevant data from the material master and display as like usual program (mm03).

Regards,

Venkat.

Read only

kabil_g
Active Participant
0 Likes
4,473

Hi Venkat,

Here when i saving the master its saving only one line in the table control..Else Data refreshing ..........Pls help me

Read only

kabil_g
Active Participant
0 Likes
4,473

Hi Venkatesh,

Still  Unable to fulfill the requirement pls hel me out

Read only

0 Likes
4,473

Hi kabil,

Sorry for late response, kindly send your  codings.

Regards,

Venkat.

Read only

kabil_g
Active Participant
0 Likes
4,473

Hi Venkatesh,

When i change the docnum system refreshing and bringing the created docnument number only

CONTROLS source TYPE TABLEVIEW USING SCREEN '1001'.

*Structure Declaration

TYPES:BEGIN OF gty_data,

         rmcode    TYPE zcalc-rmcode,

         matnr     TYPE zcalc-matnr,

         ersda     TYPE zsemi-ersda,

         werks     TYPE zcalc-werks,

         maktx     TYPE zcalc-maktx,

         specg     TYPE zcalc-specg,

         cost      TYPE zcalc-cost,

         solid     TYPE zcalc-solid,

         resin     TYPE zcalc-resin,

         crossl    TYPE zcalc-crossl,

         pigment   TYPE zcalc-pigment,

         extendl   TYPE zcalc-extendl,

         catalyst  TYPE zcalc-catalyst,

         solvent   TYPE zcalc-solvent,

         aerosil   TYPE zcalc-aerosil,

         wax       TYPE zcalc-wax,

         anti      TYPE zcalc-anti,

         other     TYPE zcalc-other,

         costm     TYPE zcalc-costm,

         variance  TYPE zcalc-variance,

         verpr     TYPE mbew-verpr,

         bwkey     TYPE mbew-bwkey,

         fgdes     TYPE zsemi-fgdes,

         docnum    TYPE zsemi-docnum,

         pbw       TYPE zsemi-pbw,

         pbv       TYPE zsemi-pbv,

         tcost     TYPE zsemi-tcost,

         control   TYPE zsemi-control,

         gcost     TYPE zsemi-gcost,

         pbvcost   TYPE zsemi-pbvcost,

         pbwcost   TYPE zsemi-pbwcost,

         contri    TYPE zsemi-contri,

         numb      TYPE zsemi-numb,

         mark,

         doc      LIKE zsemi-docnum,

       END OF gty_data.

*Internal Table & Table Structure Updation

DATA: gt_data TYPE TABLE OF gty_data,

       gw_data TYPE  gty_data,

       gt_semi TYPE TABLE OF zsemi,

       gs_semi TYPE zsemi,

       ok_code LIKE sy-ucomm.

1 St Screen PAI

WHEN OTHERS.

         SELECT * FROM zsemi INTO CORRESPONDING FIELDS OF TABLE gt_data

           WHERE docnum = gw_data-docnum.

       CALL   SCREEN 1001.

   ENDCASE.




2nd Screen



Against to these document number i need to update these line items....... Pls help me



2nd Screen

For Creation Master Initially i have wrote these codes



WHEN 'SAVE'.

       LOOP AT gt_data INTO gw_data.

         CALL FUNCTION 'NUMBER_GET_NEXT'

          EXPORTING

            nr_range_nr                   = '01'

            object                        = 'ZDEMO'

            quantity                      = '1'

*                      subobject                     = 'ZNUMB'

*                      TOYEAR                        = '0000'

             ignore_buffer                 = ''

         IMPORTING

           number                        = lv_num

*               *     QUANTITY                      =

*               *     RETURNCODE                    =

         EXCEPTIONS

           interval_not_found            = 1

           number_range_not_intern       = 2

           object_not_found              = 3

           quantity_is_0                 = 4

           quantity_is_not_1             = 5

           interval_overflow             = 6

           buffer_overflow               = 7

           OTHERS                        = 8.

         IF sy-subrc <> 0.

           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

         ENDIF.

         gs_semi-numb     = lv_num.

         gs_semi-fgdes    = gw_data-fgdes.

         gs_semi-docnum   = gw_data-docnum.

         gs_semi-ersda    = gw_data-ersda.

         gs_semi-werks    gw_data-werks.

         gs_semi-rmcode   gw_data-rmcode.

         gs_semi-matnr    gw_data-matnr.

         gs_semi-specg    gw_data-specg.

         gs_semi-cost     gw_data-cost.

         gs_semi-solid    gw_data-solid.

         gs_semi-resin    gw_data-resin.

         gs_semi-crossl   gw_data-crossl.

         gs_semi-pigment  gw_data-pigment.

         gs_semi-extendl  gw_data-extendl.

         gs_semi-catalyst gw_data-catalyst.

         gs_semi-solvent  = gw_data-solvent.

         gs_semi-aerosil  = gw_data-aerosil.

         gs_semi-wax      = gw_data-wax.

         gs_semi-anti     = gw_data-anti.

         gs_semi-other    = gw_data-other.

         gs_semi-costm    = gw_data-costm.

*        gs_semi-variance = gw_data-variance.

         gs_semi-verpr    = gw_data-verpr.

         gs_semi-pbw      = gw_data-pbw.

         gs_semi-pbv      = gw_data-pbv.

         gs_semi-tcost    = gw_data-tcost.

         gs_semi-control  = gw_data-control.

         gs_semi-contri   gw_data-contri.

         gs_semi-gcost    gw_data-gcost.

         gs_semi-pbvcost  = gw_data-pbvcost.

         gs_semi-pbwcost  = gw_data-pbwcost.

         MODIFY zsemi FROM gs_semi .

         CLEAR gs_semi.

       ENDLOOP.

       IF sy-subrc = 0.

         MESSAGE 'Data saved successfully' TYPE 'S'.

       ELSE.

         MESSAGE 'Data not saved' TYPE 'E'.

       ENDIF.

Read only

0 Likes
4,473

Hi kabil,

Please check your key fields in table.

if program is used for creation means use  INSERT  instead of  modify

Regards,

Venkat.

Read only

kabil_g
Active Participant
0 Likes
4,473

Ok I Need to change docnument number alone again tat line items has to store against which i given new docnum

when i gave new docnum data refresh and getting the old document number only

Read only

0 Likes
4,473

Hi kabil,

hope i understand if not reply me,

in table control  itab contains two entries along with doc number

declare one variable.

if doc number is not initial . flag = 'X'. endif.

when 'Save'.

if flag is not initial.

loop at gt_data  into gw_data .

gw_data-ref_doc = tablecontrol-doc number.

modify gt_data from gw_data.

endloop.

check it your itab gets modified or not.

then try  updating table.

Regards,

Venkat.

Read only

former_member202818
Active Contributor
0 Likes
4,473

Hi kabil,

Regards

Sreekanth

Read only

VenkatRamesh_V
Active Contributor
0 Likes
4,473

Hi kabil,

Did you got the output.

Regards,

Venkat

Read only

0 Likes
4,473

Hi Venkatesh,

data is refreshing unable to get it

Read only

0 Likes
4,473

Hi Kabil,

hope i understand if not reply me,

in table control  itab contains two entries along with doc number

declare one variable.

if doc number is not initial . flag = 'X'. endif.

when 'Save'.

if flag is not initial.

loop at gt_data  into gw_data .

gw_data-ref_doc = tablecontrol-doc number.

modify gt_data from gw_data.

endloop.

check it your itab gets modified with new doc number or not .

then try  updating table.

Regards,

Venkat.

Read only

0 Likes
4,473

When i change doc num if press enter getting old doc num only...before looping its not changing

after looping data getting refresh and getting old document number only..............

Read only

0 Likes
4,473

Hi Kabil,

Have you used the FIELD statement on Reference number ?

Thanks & Regards,

Arun

Read only

0 Likes
4,473

Earlier i tried aruna

Read only

0 Likes
4,473

Have you written this statement on on PBO

LOOP AT   gt_data

        WITH CONTROL source

        CURSOR source-CURRENT_LINE.

     MODULE GET_LINES

   ENDLOOP.



And


In PAI,


LOOP AT gt_data.


ENDLOOP.


Look into demo program DEMO_DYNPRO


Just want to confirm it Dont mind



Read only

0 Likes
4,473

Hi kabil,

Hope it may helpfull,

Eg: created two  Screens  100, 200 with same input.

Flow Logic.

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
CHAIN.
FIELD: bsas-hkont module input.
ENDCHAIN.

  MODULE USER_COMMAND_0100.



SCREEN 200  With same field name as  screen 100.


Flowlogic.


PROCESS AFTER INPUT.

CHAIN.
FIELD: bsas-hkont MODULE input2. "on  CHAIN-INPUT.
ENDCHAIN.



Abap Editor Program.


REPORT  ZPRODUCT.


TABLES: bsas.

data: msg TYPE string,
       itab type TABLE OF bsas WITH HEADER LINE INITIAL SIZE 0.



START-OF-SELECTION.

call screen 0100.


MODULE INPUT INPUT.         " After Input user press Enter tab

SELECT * FROM  bsas INto table itab WHERE hkont EQ bsas-hkont.

call screen 200.

ENDMODULE.             

MODULE INPUT2 INPUT. " User Changes  Input user press Enter tab

move bsas-hkont to msg.

MESSAGE msg TYPE 'S'.

loop at itab.                    "Changing the  Existing value

itab-hkont = bsas-hkont.  
modify itab.

ENDLOOP.


ENDMODULE.           




Regards,

Venkatramesh.V



Read only

0 Likes
4,473

sorry for delay....Last three days leave .. Still facing same problem data not changing....................Pls help me out

Read only

0 Likes
4,473

Hi Kabil,

Hope i understand if  i am wrong reply me,

In screen 1000.

Screen painter

Doc no:  zsemi-gw_data-docnum

In screen 1001.

Doc no:  zsemi-gw_data-docnum.

Please check while debugging  After Save you  are getting the changed  values in Screen 1001. ?.

if you are  getting means modify the values by  itab-doc = zsemi-gw_data-docnum.

Regards,

Venkat.

Read only

kabil_g
Active Participant
0 Likes
4,473

In Debugging only one line reading after tat table control refreshing and going back to old value.......

Read only

0 Likes
4,473

Hi Kabil,

try this.

Delcare one local variable,

Data: lv_doc like zsemi-gw_data-docnum.

after save.

if zsemi-gw_data-docnum is not initial.

lv_doc = zsemi-gw_data-docnum.

endif.

modify itab with lv_doc.

Regards,

Venkat.