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

Help Needed immediately

Hi,

I have an text table /bic/tmaterial and an internal table ITAB.

In a function module, i need to get the material numbers of /bic/tmaterial which are not present in ITAB-material(material is a field in internal table ITAB) and for those material no's i need to make an entry in the structure ZSTRUCTURE(which also contains a material no field).

Help me in this abap code to make the above functionality possible.

Please help as soon as possible

Thanks & Regards,

Pra

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 06:36 AM

    Hi,

    Your question is not very clear... can you pls explain the problem clearly?

    Thanks.

    Archana

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 07:25 AM

    Hi,

    take one temp. internal table which is having the structure like

    */bic/tmaterial *

    DATA : BEGIN OF i_itab OCCURS o.

    INCLUDE STRUCTURE /bic/tmaterial .

    DATA : END OF i_itab.

    select required fields into i_itab from /bic/tmaterial.

    LOOP AT i_itab.

    READ TABLE ITAB WITH KEY material = i_itab-material.

    IF sy-subrc NE 0.

    MOVE i_itab-values to your structure ZSTRUCTURE.

    ENDIF.

    ENDLOOP.

    CLEAR : i_itab.

    FREE i_itab.

    Note: you have given that ,moving fields to structure.Structure means

    it will hold only one record at a time.

    Add a comment
    10|10000 characters needed characters exceeded

    • Slightly more up-to-date, and in tabs to preserve line spacing.

      DATA: i_itab TYPE STANDARD TABLE OF /bic/tmaterial WITH NON-UNIQUE KEY material.
      
      FIELD-SYMBOLS: <wa> TYPE /bic/tmaterial.
      
      select required fields into i_itab from /bic/tmaterial.
      
      LOOP AT i_itab ASSIGNING <wa>.
        READ TABLE i_itab TRANSPORTING NO FIELDS WITH KEY material = <wa>-material.
        IF sy-subrc NE 0. 
          MOVE <wa>-values to your structure ZSTRUCTURE.
        ENDIF.
      ENDLOOP.
      
      CLEAR: i_itab.

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.