Skip to Content
avatar image
Former Member

BAPI_SALESORDER_CREATEFROMDAT2 and ORDER_CONDITIONS_IN with sapnwrfc (perl)

Hi,

with sapnwrfc packet from Piers Harding (v0.31) I try to create a salesorder within a perl script.

Without using table ORDER_CONDITIONS_IN my salesorder is created successfull in SAP.

Now I want to commit pricing information. Therefor I used ORDER_CONDITIONS_IN with syntax:

$rc->ORDER_CONDITIONS_IN([{'COND_P_UNT'=>'1', 'CURRENCY'=>'EUR', 'COND_TYPE'=>'PR00', 'ITM_NUMBER'=>'000010', 'COND_VALUE'=>'22'}]);

SAP returned an error: BCD_BADDATA

So I thought something wrong with COND_P_UNT or COND_VALUE because these have to be BCD packed values.

Now I tried something like

pack("H*", "22")

for COND_VALUE and so on. But without success.

Some values I commited in table ORDER_ITEMS_IN are marked as BCD but I have to send them in "plain" text, no pack function to call...

So, did you have any idea for solving my problem?

Is it possible that another (incomplete) table is responsible for my problem?

Or do you think the reason is dedicated to table ORDER_CONDITIONS_IN?

Any help or suggestion appreciated!

Regards,

Patrick

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 12, 2011 at 04:22 PM

    So you're looking to populate the ORDER_CONDITIONS_IN structure. Here's an example of how I've populated two structures OPTIONS and FIELDS:

    my $it = $rfc->function_lookup("RFC_READ_TABLE");
    my $rcb = $it->create_function_call;
    $rcb->QUERY_TABLE("SNAP");
    $rcb->DELIMITER(";");
    $rcb->OPTIONS([{'TEXT' => "SEQNO = '000' AND "},{'TEXT' => "(DATUM > '$mindate' OR (DATUM = '$mindate' AND UZEIT > '$mintime'))"}]);
    $rcb->FIELDS([{'FIELDNAME' => 'DATUM'},{'FIELDNAME' => 'UZEIT'},{'FIELDNAME' => 'AHOST'},{'FIELDNAME' => 'UNAME'},{'FIELDNAME' => 'MANDT'},{'FIELDNAME' => 'FLIST'}]);
    $rcb->invoke;
    

    Hope that helps,

    david.

    Add comment
    10|10000 characters needed characters exceeded