Skip to Content
avatar image
Former Member

Sap script vba excel compare field

Hello,

I am new and doesn't know much about scripting.

But can anyone help me with a script that i can use to compare a field from sap and excel.

And if both fields are the same it must enter some data at sap

Example.

Excel

00069114_P 

SAP (MM02 MRP 1 and button MRP AREA)

00069114_P

0069114_P the same value

then it must select the field at sap.

Sorry for mine bad english.

Greetings Raoul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 06, 2014 at 03:19 PM

    Hello.

    May you can perform a script recording from call Transaction MM02 until you touch all fields which should in scope and should compared.

    Cause in some Environments not all Options are enabled like in your Environment. (E.g. we have not button MRP area enbaled in our System for Transaction MM02).

    With a script recording we should be able to suggest some way how you can achieve your requirements.

    Best regards,

    Holger

    Add comment
    10|10000 characters needed characters exceeded

    • Hello.

      I suggest you make a FOR-NEXT VBA Loop over all lines in your Excel WB sheet. Fill required variables with fields from line.

      A second Loop (e.g. DO UNTIL) for the MRP-area value. There I suggest to record a scroll of existing MRP-lines as it is easier to take everytime top line for compare than dynamic move.

      If MRP-area field value = Excel field value your update Action can initate.

      If MRP-area value not exist or Loop runs into empty field next line from FOR-NEXT Loop should called.

      Hope this give you some ideas.

      Best regards

      Holger