Dailycode.info

Short solution for short problems

SAP: Adobe forms not printing the quantity set in VV32

When printing PDF invoices or any other document in SAP, you need to give the correct output parameters.

My problem was that when I specified 3 as quantity (ANZAHL) as the number of copies to print. But everytime only 1 appeared.

At the end, the problem was solved by settings the number of copies to the NAST-ANZAHL parameter:

fp_outputparams-copies    = nast-anzal.

So the complete set of parameters looks like this:

IF gv_e_invoice EQ 'X'.

    fp_outputparams-preview       = 'X'.

    fp_outputparams-nodialog      = gv_e_invoice.

 

  ELSE.

    fp_outputparams-reqimm        = 'X'.

    fp_outputparams-preview       = 'X'.

    fp_outputparams-nodialog      = 'X'.

    fp_outputparams-copies    = nast-anzal.

  ENDIF.

 

  fp_outputparams-covtitle      = 'Invoice'.

  fp_outputparams-reqnew        = 'X'.

  fp_outputparams-reqfinal      = 'X'.

 

  IF NOT nast-ldest IS INITIAL.

    fp_outputparams-dest = nast-ldest.

  ELSE.

    fp_outputparams-dest          = 'LP01'.

  ENDIF.

 

  fp_outputparams-getpdf        = gv_e_invoice.

I have a difference when generating PDF for email. On our development system this did the trick.

But then on the QAS system it still ony printed 1 time. The solution to this couldn't be in the code, for it worked on development. It appeared to be a printer setting in SAP that wasn't correct. I had to set the Host Spool Access Method to C: Direct operating system call. 

 


SAP: Program (IS_VARIANT-REPORT) not specified (SAP Message 0K522)

I looked on the internet for a while, but couldn't find a solution that worked for me.
I noticed that when I used the transaction, this error came, but when I ran the program from SE383 it didn't gave any error.

So I looked myself for a short while and found out that it was the transaction I created that had a problem. I recreated the transaction using SE80. First I deleted the old transaction. Then I created the transaction following these steps:

1. Create the tranaction:

2. Select the second option from the list:

3. Then fill in the program behind the transaction and save.



I believe the mistake I did was the first time I created the transaction, I selected the first option in step 2.

SAP: Adobe Forms - Print Sales conditions on the back.

There are many solutions to find for something you would expect to be kind of default functionality. But no, no default, rahter painfull when you are figuring out you selve. In my opinion, the setup is not logic. If you try the logic way, you'll get strange and unexpected behaviour.  

So the one solution that works for me in all cases is still the by far simplest solution I found here!

Start with putting your pageset to Print on both sides:

 

To use this solution, you'll need 2 extra pages (I called them BackPage and Dummy). 

Then you set the first page (the page that contains your data) like this:

Next you set the backpage like this:

And last the last page (Dummy) like this:

This will make sure that any blank page is set to the sales conditions. This page doesn't have a content area, only the text of the salesconditions:

 

Now finally very important is to tell the content to where is has to go when the page is full. It must go to the content area of the FirstPage, not the content area of the back page. If we leave the field blank, it will automatically put the items on the back page.

 

 -->  --> 

Now the pages will come out nicely  with the sales conditions on the back, when there's only 1 page or more pages.

Just as example how you can design your sales conditions:

 

And the result:


iOS: Make a simple iOS7 ready button by subclassing UIButton

Very simple solution, but works like a charm.

Create a subclass of UIButton. 

There we overload the initFrame and important also the awakeFromNib:

- (id)initWithFrame:(CGRect)frame

{

    self = [super initWithFrame:frame];

    if (self) {

        // Initialization code

        [GeneralFunctionsMakeNormalButton:self];

    }

    returnself;

}

 

-(void) awakeFromNib

{

    [GeneralFunctionsMakeNormalButton:self];

 

}

 
This general function looks like this:

+ (void) MakeNormalButton:(UIView *) vw

{

    vw.backgroundColor= [UIColorwhiteColor];

    [vw.layersetCornerRadius:10.0f];

    [vw.layersetBorderColor:[UIColorblueColor].CGColor];

    [vw.layersetBorderWidth:1.0f];

    [vw.layersetShadowColor:[UIColorgrayColor].CGColor];

    [vw.layersetShadowOpacity:0.5];

    [vw.layersetShadowRadius:2.0];

    [vw.layersetShadowOffset:CGSizeMake(2.0f, 2.0f)];

}

Now we also overwrite the setHighlighted method to show the button was selected:

-(void) setHighlighted:(BOOL)highlighted

{

    if (highlighted)

    {

        [selfhighLightView];

    }

    else

    {

        [selfcleanHighLightView];

    }

    [super setHighlighted:highlighted];

 

}

 

-(void) highLightView

{

    self.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);

    self.layer.shadowOpacity = 0.25;

    self.backgroundColor= [UIColorblueColor];

}

 

-(void) cleanHighLightView

{

    self.layer.shadowOffset = CGSizeMake(2.0f, 2.0f);

    self.layer.shadowOpacity = 0.5;

    self.backgroundColor= [UIColorwhiteColor];

}

 

Now you can change the class of your button in the storyboard designer to this class and your buttons get the new layout, no more programming todo.

 

Then from button less iOS 7 and button richt iOS 6 you get a uniform layout with very few changes. In the examples below, you'll see the iOS 6 layout on top, iOS 7 on the bottom.