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

Read Varinat Configuration Charachteristics of a materail from Sales Order

Hi ,

My requirement is to read the Varinat Configuration Characteristics of a configurable material for a sales order.

I have the sales order number and from there i have to trace back the characteristic values of the material used which would change for each sales order.

We are using text as a chracteristic for the varinat config material and i need to read the text. so please help me with how to trace the Characteristic values of a material for a given sales order number

VC_I_GET_CONFIGURATION_IBASE how to use this function module?

Can some one suggest me the sample code?

Regards,

Jessica.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 05:05 PM

    Hi,

    Ok Jus pass

    instance = lx_vbap-cuobj

    LANGUAGE = SY-LANGU

    in the FM.

    You can get the cuobj from VBAP table. Pass Vbeln in VBAP and check for CUOBJ value, Pass the Cuobj in this FM.

    Edited by: senthil kumar on Oct 29, 2008 10:36 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I said if you want to take only one description use READ table, else use LOOP and CASE.

      Your way of doing this is not suggestable.

      Check this example.

      declare a new internal table for the structure you want and move the required values to the new itab and write it down.

      Data : itab1 type itab occurs 0 with header line.

      Loop at itab.

      Case itab-atnam.

      When u2018'CH_MSG1_LINE1u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      When u2018'CH_MSG1_LINE2u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      When u2018'CH_MSG2_LINE1u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      When u2018'CH_MSG2_LINE2u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      When u2018'CH_MSG3_LINE1u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      When u2018'CH_MSG3_LINE2u2019.

      Move itab-atnam to itab1-atnam.

      Move itab-atwrt to itab1-atwrt.

      .

      .

      .

      Endcase.

      Append itab1.

      Clear itab1.

      Endloop.

      Loop at itab1.

      Write :/ itab1-atnam, itab1-atwrt.

      Endloop.

      I dont know how do you get duplicate entries??

      I said in my earlier post to clear the body of the internal table.

      You have used clear itab, which only clears the work area as you have not explicitly declared the workarea. Please use Refresh itab next line of the clear itab.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 05:08 PM

    Hi,

    get the object no of the material from VBAP table field name is CUOBJ and pass that object no and language to the function module . You will get all configuration details to the internal table

    TABLES

    configuration = it_configuration

    and based on the characteristic name get the values.

    i hope this clarifies u.

    Regards,

    Suresh.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 05:10 PM

    Check this.

    Select single cuobj into v_cuobj where vbeln = p_vbeln.

    CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'

    EXPORTING

    INSTANCE = v_cuobj

    LANGUAGE = SY-LANGU

    TABLES

    CONFIGURATION = t_conf

    EXCEPTIONS

    INSTANCE_NOT_FOUND = 1

    OTHERS = 2

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 07:03 PM

    Hey Senthil,

    My requirement is to read the varinat characteristcs from Sales order, but i dont want to read all values.

    I want to read only Characteristic value, that is ATWRT value of CONF_OUT table only when ATNAM is CH_MSG_IMAGE_OPTION.

    CH_MSG_IMAGE_OPTION this is a custom one that they configured while doing Varinat Configuration.

    Now i put a logic such that if the ATNAM = CH_MSG_IMAGE_OPTION then read ATWRT, but it is not working. i am able to read all values but my req is to only read values when ATNAM = CH_MSG_IMAGE_OPTION

    This my code, but i am not getting any output. can you help me with this.

    If i know in which table the information is, then may be i can trace back and out a logic to pick only the values that i want.

    • Define the data elements

    DATA: xaufnr TYPE afko-aufnr.

    DATA: xltxa1 TYPE afvc-ltxa1.

    DATA: xaplzl TYPE afvc-aplzl.

    data: xaufk type aufk.

    DATA: XKDAUF type afpo-kdauf.

    data: it_conf_out like CONF_OUT occurs 0 with header line.

    data: xcuobj type VBAP-cuobj.

    DATA: CH_MSG_IMAGE_OPTION type CONF_OUT-ATNAM.

    Parameters

    PARAMETERS: p_rueck type afvc-rueck.

    To obtain the Production Order Number for a given production order confirmation number***

    ***Select Query for retrieving the production order number from production confirmation number

    ***Tables Used: afko (for production order num) , afvc (for production confirmation num)

    SELECT r1~aufnr

    INTO xaufnr

    FROM afko AS r1

    INNER JOIN

    afvc AS r2

    ON r1aufpl = r2aufpl WHERE r2~rueck = p_rueck AND ltxa1 = 'candy jet' .

    ENDSELECT.

    to obtain the sales order number from production order number

    SELECT kdauf INTO xkdauf FROM AFPO where aufnr = xaufnr.

    ENDSELECT.

    to obtain the cuobj for the sales order number

    select cuobj into xcuobj from VBAP where vbeln = xkdauf.

    endselect.

    call function to get the characteristic values from sales order

    CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'

    EXPORTING

    INSTANCE = xcuobj

    LANGUAGE = SY-LANGU

    TABLES

    CONFIGURATION = it_conf_out.

    *loop at it_conf_out.

    *write:/ it_conf_out-ATwrt.

    *endloop.

    IF it_conf_out-atnam = CH_MSG_IMAGE_OPTION.

    write: it_conf_out-ATwrt.

    endif.

    if i am writing

    loop at it_conf_out.

    write:/ it_conf_out-ATwrt.

    endloop.

    i am reading all values, i need to read only few values and i put logic such that

    IF it_conf_out-atnam = CH_MSG_IMAGE_OPTION.

    write: it_conf_out-ATwrt.

    endif.

    but not getting any o/p

    can u tell me where i am missing

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2008 at 03:58 PM

    Thanks to all people who helped me with timely inputs

    Add a comment
    10|10000 characters needed characters exceeded

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.