Skip to Content
author's profile photo Former Member
Former Member

Sap script vba excel compare field


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




SAP (MM02 MRP 1 and button MRP AREA)


0069114_P the same value

then it must select the field at sap.

Sorry for mine bad english.

Greetings Raoul

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 06, 2014 at 03:19 PM


    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,


    Add a 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


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.